OFFSET
1,5
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
1, 1(<2=1+1), 1(<3=2+1), 1(<4=3+1), 4(<5=4+1), 8(<9=5+4), 12(<14=6+8), 9(<10=7+1+2), etc.
MAPLE
Contribution from R. J. Mathar, May 21 2010: (Start)
A007953 := proc(n) add(d, d=convert(n, base, 10)) ; end proc:
A158457 := proc(n) if n = 1 then 1; else for a from A007953(n-1)+A007953(procname(n-1))-1 by -1 do if not isprime(a) then return a; end if; end do; end if; end proc:
seq(A158457(n), n=1..120) ; (End)
MATHEMATICA
lnp[{n_, a_}]:=Module[{sd=Total[IntegerDigits[n+1]]+Total[ IntegerDigits[ a]]-1}, While[PrimeQ[sd], sd--]; {n+1, sd}]; NestList[lnp, {0, 1}, 80][[All, 2]] (* Harvey P. Dale, May 28 2021 *)
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Juri-Stepan Gerasimov, Mar 19 2009
EXTENSIONS
Entries checked by R. J. Mathar, May 21 2010
STATUS
approved