OFFSET
1,1
COMMENTS
Trailing zeros in n + k^2 are not allowed.
a(n) = 1 iff n+1 is in A074896.
LINKS
Michel Marcus, Table of n, a(n) for n = 1..498 (terms 1..148 from Robert Israel).
EXAMPLE
a(4) = 12 because 4 + 12^2 = 148 is the digit reversal of 841 = 29^2, and no smaller k works.
MAPLE
rev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
f:= proc(n) local v, k;
for k from 1 do
v:= n+k^2;
if v mod 10 = 0 then next fi;
v:= rev(v);
if issqr(v) then return k fi;
od
end proc:
map(f, [$1..100]);
MATHEMATICA
a[n_]:=Module[{k=1}, While[Mod[n+k^2, 10]==0||!IntegerQ[Sqrt[IntegerReverse[n+k^2]]], k++]; k] (* James C. McMahon, Feb 16 2026 *)
PROG
(PARI) a(n) = my(k=1); while (!(((n+k^2)%10) && issquare(fromdigits(Vecrev(digits(n+k^2))))), k++); k; \\ Michel Marcus, Feb 09 2026
(PARI) a(n) = {my(d = [1..20]); for(i = 1, 10, if((i^2 + n) % 10 == 0, d = setminus(d, Set([i, i+10])))); d = select(x->x<=d[1]+10, d); step = vector(#d-1, i, d[i+1]-d[i]);
forstep(i = d[1], oo, step, if(issquare(fromdigits(Vecrev(digits(n+i^2)))), return(i)))} \\ David A. Corneth, Feb 17 2026
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Feb 09 2026
STATUS
approved
