A035137 Numbers that are not the sum of 2 palindromes (where 0 is considered a palindrome).
21, 32, 43, 54, 65, 76, 87, 98, 201, 1031, 1041, 1042, 1051, 1052, 1053, 1061, 1062, 1063, 1064, 1071, 1072, 1073, 1074, 1075, 1081, 1082, 1083, 1084, 1085, 1086, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1099, 1101, 1103, 1104, 1105, 1106, 1107, 1108
Offset: 1
Links
- David W. Wilson, Table of n, a(n) for n = 1..10000
- Javier Cilleruelo and Florian Luca, Every positive integer is a sum of three palindromes, arXiv:1602.06208 [math.NT], 2016.
- P. De Geest, World!Of Numbers
- Hugo Pfoertner, Plot of first 10^6 terms
- Eric Weisstein's World of Mathematics, Palindromic Number
Crossrefs
Programs
-
Haskell
a035137 n = a035137_list !! (n-1) a035137_list = filter ((== 0) . a260254) [0..] -- Reinhard Zumkeller, Jul 21 2015
-
Maple
N:= 4: # to get all terms with <= N digits revdigs:= proc(n) local L,j,nL; L:= convert(n,base,10); nL:= nops(L); add(L[j]*10^(nL-j),j=1..nL); end proc; palis:= $0..9: for d from 2 to N do if d::even then palis:= palis, seq(x*10^(d/2)+revdigs(x),x=10^(d/2-1)..10^(d/2)-1) else palis:= palis, seq(seq(x*10^((d+1)/2)+y*10^((d-1)/2)+revdigs(x),y=0..9),x=10^((d-3)/2)..10^((d-1)/2)-1); fi od: palis:= [palis]: A:= Array(0..10^N-1): A[palis]:= 1: B:= SignalProcessing:-Convolution(A,A): select(t -> B[t+1] < 0.5, [$1..10^N-1]); # Robert Israel, Jun 22 2015
-
Mathematica
palQ[n_]:=FromDigits[Reverse[IntegerDigits[n]]]==n; nn=1108; t={}; Do[i=c=0; While[i<=n && c!=1,If[palQ[i] && palQ[n-i], AppendTo[t,n]; c=1]; i++],{n,nn}]; Complement[Range[nn],t] (* Jayanta Basu, May 12 2013 *)
-
PARI
is_A035137(n)={my(k=0);!until(n<2*k=nxt(k),is_A002113(n-k)&&return)} \\ Uses function nxt() given in A002113. Not very efficient for large n, better start with k=n-A261423(n). Maybe also better use A261423 rather than nxt(). - M. F. Hasler, Jul 21 2015
Comments