login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Largest n-digit term of A087597, or 0 if no such number exists.
4

%I #18 Jul 29 2024 06:18:25

%S 6,78,666,7503,82621,828828,7552441,87311505,557362578,9901692450,

%T 88893307128,934624072410,9836548472766,99245275962778,

%U 994337011743076,5535761776004778,89253915287999385,865474782199906830,9888742361454004621

%N Largest n-digit term of A087597, or 0 if no such number exists.

%C Conjecture: No term is zero.

%e a(4) = 7503, A040115(7503) = 253 is triangular.

%o (PARI) dd(k)={ local(kshf,res,dig,odig,p) ; kshf=k ; res=0 ; odig=kshf % 10 ; p=0 ; while(kshf>9, kshf=floor(kshf/10) ; dig=kshf % 10 ; res += 10^p*abs(dig-odig) ; odig=dig ; p++ ; ) ; return(res) ; } isA000217(n)={ if( issquare(1+8*n), return(1), return(0) ) ; } A000217(n)={ return(n*(n+1)/2) ; } ndigs(n)={ local(nshft,res) ; res=0 ; nshft=n; while(nshft>0, res++ ; nshft=floor(nshft/10) ; ) ; return(res) ; } isA087597(n)={ if( isA000217(n) && isA000217(dd(n)), return(1), return(0) ) ; } A087600(n)={ local(k,T) ; k=ceil(-0.5+sqrt(0.25+2*10^n)) ; T=A000217(k) ; if(ndigs(T)>n, k-- ) ; while(1, T=A000217(k) ; if(ndigs(T)<n, return(0) ) ; if( isA087597(T), return(T) ) ; k-- ; ) ; } { for(n=2,21, print1(A087600(n),",") ; ) ; } \\ _R. J. Mathar_, Nov 19 2006

%Y Cf. A000217, A087597, A087598, A087599.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Sep 18 2003

%E More terms from _R. J. Mathar_, Nov 19 2006

%E a(16)-a(18) from _Donovan Johnson_, Jul 28 2010

%E a(19) from _Donovan Johnson_, Jun 19 2011

%E a(1)=6 prepended by _Max Alekseyev_, Jul 27 2024