login
A239878
Numbers n with digit_sum(n*n) + 1 = digit_sum((n+1)*(n+1)).
4
0, 18, 27, 36, 45, 72, 81, 108, 153, 198, 216, 225, 243, 252, 270, 297, 306, 342, 369, 396, 423, 441, 450, 477, 486, 495, 504, 513, 522, 549, 558, 576, 603, 630, 639, 657, 693, 702, 729, 747, 756, 783, 801, 846, 891, 918, 954, 963, 972, 981
OFFSET
1,2
COMMENTS
All terms are divisible by 9.
The number of terms is unlimited: n = 3*10^z + 6, i.e., digit_sum(n*n) + 1 = 27 + 1 = 28 = digit_sum((n+1)*(n+1)). - Reiner Moewald, Apr 20 2014
LINKS
FORMULA
A240752(a(n)) = 1. - Reinhard Zumkeller, Apr 12 2014
PROG
(Python)
def digit_Sum(n):
...integerString = str(n)
...digit_Sum=0
...for digitLetter in integerString:
......digit_Sum = digit_Sum + int(digitLetter)
...return digit_Sum
count = 0;
for i in range(20000):
...if(digit_Sum(i*i) + 1 == digit_Sum((i+1)*(i+1))):
......count = count +1
......print(anz, " ", i);
(PARI) isok(n) = (sumdigits(n^2) + 1) == sumdigits((n+1)^2); \\ Michel Marcus, Apr 06 2014
(Haskell)
import Data.List (elemIndices)
a239878 n = a239878_list !! (n-1)
a239878_list = elemIndices 1 a240752_list
-- Reinhard Zumkeller, Apr 12 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reiner Moewald, Mar 28 2014
STATUS
approved