login
A393705
a(n) is the number of ways to write n as the sum of a square and the reverse of a square.
2
1, 2, 1, 0, 2, 2, 0, 0, 1, 2, 2, 0, 0, 2, 0, 0, 1, 1, 2, 1, 1, 0, 1, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 0, 2, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 2, 0, 1, 2, 1, 1, 1, 0, 1, 0, 0, 2, 2, 1, 2, 2, 0, 2, 2, 0, 1, 1, 1, 1, 0, 0, 0, 2, 0, 1, 0, 1, 3, 0, 0, 1, 1, 0, 2, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1
OFFSET
0,2
COMMENTS
a(n) is the number of ways to write n = x + y where x is in A000290 and y is in A074896.
a(n) = 0 if n == 3 or 6 (mod 9).
LINKS
EXAMPLE
a(34) = 2 because 34 = 16 + 18 = 25 + 9 where 16 and 25 are squares and 18 and 9 are the reverses of the squares 81 and 9.
MAPLE
rev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
V:= Array(0..1000):
for x from 0 while x^2 <= 1000 do
V[x^2]:= V[x^2] + 1;
for i from 1 to 9 do
for j from 0 while (10*j+i)^2 < 1000 do
y:= x^2 + rev((10*j+i)^2);
if y <= 1000 then V[y]:= V[y]+1 fi;
od od od:
convert(V, list);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Feb 25 2026
STATUS
approved