OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
5699 is in the sequence because 5699 = 76^2 - 76 - 1, the sum of its digits is 5 + 6 + 9 + 9 = 29, and 29 can be written as 6^2 - 6 - 1.
MATHEMATICA
nset=Table[n^2-n-1, {n, 200}]; Rest[Select[nset, MemberQ[nset, Total[ IntegerDigits[ #]]]&]] (* Harvey P. Dale, Jan 22 2011 *)
PROG
(PARI)
upto(n) = {
my(res = List());
for(i = 2, sqrtint(n) + 1,
c = i^2 - i - 1;
if(issquare(4*sumdigits(c) + 5),
listput(res, c)
)
);
res
} \\ David A. Corneth, Jan 04 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), Apr 14 2006
STATUS
approved