ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1335. Белый тезис

(n*n) (n*n + n + 1) (n*n + 1) =====> O(1) soln
Послано manishmmulani 6 янв 2008 02:34
Re: (n*n) (n*n + n + 1) (n*n + 1) =====> O(1) soln
Послано Rustambek_UWED 7 май 2008 17:44
Thank you very much for the formula. I can prove it. But had not found it.
Re: (n*n) (n*n + n + 1) (n*n + 1) =====> O(1) soln
Послано Desperados[KhAI] >> Starov_Lesha 15 июн 2008 15:58
Something very dark...
The solution is more easy and more easy to understand too!
Re: (n*n) (n*n + n + 1) (n*n + 1) =====> O(1) soln
Послано Denis Koshman 24 июл 2008 16:09
n^2+n, n^2+2n, n^2
Re: (n*n) (n*n + n + 1) (n*n + 1) =====> O(1) soln
Послано Megatron 10 мар 2009 10:49
I can prove it . but i don't know how did you come out with that?
Re: (n*n) (n*n + n + 1) (n*n + 1) =====> O(1) soln
Послано IgorKoval(from Pskov) 3 дек 2011 03:37
Megatron писал(a) 10 марта 2009 10:49
I can prove it . but i don't know how did you come out with that?

It's simple.
Just c=n^2 ( by intuition ). So, find a and b.
a=n^2+c and b=n^2+d ( because n^2 <= a,b,c <= (n+1)^2 = n^2 + 2*n + 1 ), where c and d is positive and c!=d( because a!=b(by text of this problem ) )

a^2 + b^2 = (n^2+c)^2 + (n^2+d)^2 = 2*n^4 + 2*n^2(c+d) + c^2 + d^2

Look at this 2*n^4 + 2*n^2(c+d) + c^2 + d^2. Each summand must be divisible on c=n^2.
So, just, c = n and d = 2*n
Answer:
a = n^2 + n
b = n^2 + 2*n
c = n^2

P.S.:
You can say just a = n^2 and analogous prove another formula.

Edited by author 03.12.2011 03:41
Re: (n*n) (n*n + n + 1) (n*n + 1) =====> O(1) soln
Послано LyanA 21 янв 2013 20:11
i was very surprised
it's just 3 strings of code
you're perfect =)