OFFSET
1,1
COMMENTS
First differences are 48, 56, 40, 40, 61, 51, 40, 40, 61, 91, 40, 61, 91, 40, 61, 91, 40, 40, 112, 440, 440, ...
This sequence is obviously infinite. (10^n - 1)/9 is a member of this sequence for all n > 2.
Proof : A004215 lists numbers of the form 4^i*(8*j+7) where i,j >= 0. So numbers of the form 8*j+7 is always in A004215 for i = 0, j >= 0. Since (10^n - 1)/9 - 7 = (10^n - 2^6)/9 = (2^n*5^n - 2^6)/9 = 2^3*(2^(n-3)*5^n - 2^3)/9, (10^n - 1)/9 - 7 is always divisible by 2^3 for n > 2, that means (10^n - 1)/9 is number of the form 8*j + 7 for n > 2. Trivially, (10^n - 1)/9 is always a palindrome for positive n, that is (10^n - 1)/9 is member of this sequence for all n > 2.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
44 is not a term because 44 = 2^2 + 2^2 + 6^2.
55 is a term because 55 = x^2 + y^2 + z^2 has no solution for integer values of x, y, z.
MAPLE
revdigs:= proc(x) local L, i;
L:= convert(x, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
palis:= proc(d) local x;
if d::even then seq(x*10^(d/2)+revdigs(x), x=10^(d/2-1)..10^(d/2)-1)
else seq(x*10^((d-1)/2)+revdigs(floor(x/10)), x=10^((d-1)/2)..10^((d+1)/2)-1)
fi
end proc:
filter:= proc(x) local i;
i:= floor(padic:-ordp(x, 2)/2);
x/4^i mod 8 = 7
end proc:
select(filter, [seq(palis(d), d=1..5)]); # Robert Israel, May 09 2018
MATHEMATICA
Select[Range[16000], And[! SquaresR[3, #] > 0, Reverse@ # == # &@ IntegerDigits@ #] &] (* Michael De Vlieger, May 08 2016 *)
PROG
(PARI) isA002113(n) = {my(d = digits(n)); (subst(Polrev(d), x, 10) == n); }
isA004215(n) = {n\4^valuation(n, 4)%8==7}
lista(nn) = for(n=1, nn, if(isA002113(n) && isA004215(n), print1(n, ", ")));
CROSSREFS
KEYWORD
AUTHOR
Altug Alkan, May 08 2016
STATUS
approved