login
A117650
Heptagonal numbers for which the sum of the digits is also a heptagonal number.
1
0, 1, 7, 34, 189, 403, 783, 1782, 2673, 3186, 3744, 4347, 6426, 7209, 8037, 8910, 10791, 11122, 12852, 13950, 15093, 16281, 17514, 21022, 21483, 24354, 27405, 30636, 32319, 34047, 35820, 39501, 41409, 43362, 45360, 47403, 51624, 53802, 56025
OFFSET
0,3
LINKS
EXAMPLE
196981 is in the sequence because it is a heptagonal number and the sum of its digits (34) is also a heptagonal number.
MAPLE
N:= 10000: # to search the first N heptagonal numbers
sd:= n -> convert(convert(n, base, 10), `+`):
hept:= x -> type((3+sqrt(9+40*x))/10, integer) or x = 0:
select(hept @ sd, [seq(n*(5*n-3)/2, n=0..N)]);
# Robert Israel, Feb 14 2013
PROG
(PARI) isok(n) = ispolygonal(n, 7) && ispolygonal(sumdigits(n), 7);
for(n=0, 1e5, if(isok(n), print1(n, ", "))) \\ Altug Alkan, Dec 08 2015
CROSSREFS
Cf. A000566.
Sequence in context: A177140 A372411 A027233 * A370618 A365474 A273221
KEYWORD
nonn,base
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), Apr 11 2006
EXTENSIONS
a(0)=0 inserted by Georg Fischer, Mar 27 2024
STATUS
approved