%I #9 Jan 13 2019 03:08:55
%S 1,16,64,441,1331,1369,9261,10201,10648,80089,91125,501264,4019679,
%T 9006001,10077696,60000516,60236288,80013025,500566184,4000056516,
%U 6008715432,20000182084,40036787461,100000147984,400152624409
%N Slowest increasing sequence of alternatively cubes and squares with common neighbor digits.
%C No term ending in zero is allowed.
%e 1 (cube), 16(square): common neighbor digits = 1,
%e 16(square), 64(cube): common neighbor digits = 6,
%e 64(cube), 441(square): common neighbor digits = 4, etc.
%p A168091 := proc(n) if n = 1 then 1; elif n mod 2 = 0 then pdig := op(1,convert( procname(n-1),base,10)) ; for b from 1+floor(sqrt(procname(n-1))) do a := b^2 ; adg := convert(a,base,10) ; if op(-1,adg) = pdig and op(1,adg) <> 0 then return a ; end if; end do ; else pdig := op(1,convert( procname(n-1),base,10)) ; for b from 1+floor(root[3](procname(n-1))) do a := b^3 ; adg := convert(a,base,10) ; if op(-1,adg) = pdig and op(1,adg) <> 0 then return a ; end if; end do ; end if; end proc: for n from 1 do printf("%d,\n",A168091(n)) ; end ; # _R. J. Mathar_, Jan 25 2010
%Y Cf. A167994.
%K base,nonn
%O 1,2
%A _Zak Seidov_, Nov 18 2009
%E Corrected from a(10) on by _R. J. Mathar_, Jan 25 2010
%E More terms from _Jon E. Schoenfield_, Jul 17 2010
|