Displaying 1-10 of 20 results found.
Numbers of the form |m - R(m)| for m in A035137, where R(m) denotes the digit-reversal of m.
+20
1
9, 90, 99, 180, 189, 270, 279, 360, 369, 450, 459, 540, 549, 630, 639, 720, 729, 810, 819, 900, 990, 999, 1089, 1179, 1269, 1359, 1449, 1539, 1629, 1719, 1728, 1800, 1809, 1908, 1980, 2079, 2088, 2268, 2358, 2448
COMMENTS
Created in an attempt to understand A035137. It would be nice to have an independent definition of these numbers. Obviously they are multiples of 9 - see A261909.
EXAMPLE
21, 102, 1031 are some early terms in A035137, so this sequence contains 21-12=9, 201-102=99, 1301-1031=270.
Number of ways to write n as the sum u+v+w of three palindromes (from A002113) with 0 <= u <= v <= w.
+10
19
1, 1, 2, 3, 4, 5, 7, 8, 10, 12, 13, 15, 16, 17, 17, 18, 17, 17, 16, 15, 13, 12, 11, 10, 9, 8, 7, 7, 6, 6, 6, 6, 5, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 12, 8, 8, 8
COMMENTS
It is known that a(n) > 0 for every n, i.e., every number can be written as the sum of 3 palindromes.
The graph has a kind of self-similarity: looking at the first 100 values, there is a Gaussian-shaped peak centered at the first local maximum a(15) = 18. Looking at the first 10000 values, one sees just one Gaussian-shaped peak centered around the record and local maximum a(1453) = 766, but to both sides of this value there are smaller peaks, roughly at distances which are multiples of 10. In the range [1..10^6], one sees a Gaussian-shaped peak centered around the record a(164445) = 57714. In the range [1..3*10^7], there is a similar peak of height ~ 4.3*10^6 at 1.65*10^7, with smaller neighbor peaks at distances which are multiples of 10^6, etc. - M. F. Hasler, Sep 09 2018
EXAMPLE
a(0)=1 because 0 = 0+0+0;
a(1)=1 because 1 = 0+0+1;
a(2)=2 because 2 = 0+1+1 = 0+0+2;
a(3)=3 because 3 = 1+1+1 = 0+1+2 = 0+0+3.
a(28) = 6 since 28 can be expressed in 6 ways as the sum of 3 palindromes, namely, 28 = 0+6+22 = 1+5+22 = 2+4+22 = 3+3+22 = 6+11+11 = 8+9+11.
MAPLE
local xi, yi, x, y, z, a ;
a := 0 ;
for xi from 1 do
if 3*x > n then
return a;
end if;
for yi from xi do
if x+2*y > n then
break;
else
z := n-x-y ;
if z >= y and isA002113(z) then
a := a+1 ;
end if;
end if;
end do:
end do:
return a;
end proc:
MATHEMATICA
pal=Select[Range[0, 1000], (d = IntegerDigits@ #; d == Reverse@ d)&]; a[n_] := Length@ IntegerPartitions[n, {3}, pal]; a /@ Range[0, 1000]
PROG
(PARI) A261132(n)=n||return(1); my(c=0, i=inv_ A002113(n)); A2113[i] > n && i--; until( A2113[i--]*3 < n, j = inv_ A002113(D = n-A2113[i]); if( j>i, j=i, A2113[j] > D && j--); while( j >= k = inv_ A002113(D - A2113[j]), A2113[k] == D - A2113[j] && c++; j--||break)); c \\ For efficiency, this uses an array A2113 precomputed at least up to n. - M. F. Hasler, Sep 10 2018
EXTENSIONS
Examples revised and plots for large n added by Hugo Pfoertner, Aug 11 2015
Numbers that can be written as the sum of two nonnegative palindromes in base 10.
+10
13
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120
COMMENTS
More than the usual number of terms are shown in order to distinguish this from A261906. - N. J. A. Sloane, Sep 09 2015
MATHEMATICA
palQ[n_Integer, base_Integer] := Block[{}, Reverse[idn = IntegerDigits[n, base]] == idn]; Take[ Union[ Plus @@@ Tuples[ Select[ Range[0, 100], palQ[#, 10] &], 2]], 90] (* Robert G. Wilson v, Jul 22 2015 *)
PROG
(Haskell)
a260255 n = a260255_list !! (n-1)
a260255_list = filter ((> 0) . a260254) [0..]
CROSSREFS
111 is a member of this sequence but not of A261906. A213879 lists the differences.
Number of ways to write n as sum of two palindromes in decimal representation.
+10
12
1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1
EXAMPLE
. n | a(n) | n | a(n) |
. ----+------+-------------------------- ----+------+--------------
. 0 | 1 | 0 21 | 0 | ./.
. 1 | 1 | 1 22 | 2 | 22, 11+11
. 2 | 2 | 2, 1+1 23 | 1 | 22+1
. 3 | 2 | 3, 2+1 24 | 1 | 22+2
. 4 | 3 | 4, 3+1, 2+2 25 | 1 | 22+3
. 5 | 3 | 5, 4+1, 3+2 26 | 1 | 22+4
. 6 | 4 | 6, 5+1, 4+2, 3+3 27 | 1 | 22+5
. 7 | 4 | 7, 6+1, 5+2, 4+3 28 | 1 | 22+6
. 8 | 5 | 8, 7+1, 6+2, 5+3, 4+4 29 | 1 | 22+7
. 9 | 5 | 9, 8+1, 7+2, 6+3, 5+4 30 | 1 | 22+8
. 10 | 5 | 9+1, 8+2, 7+3, 6+4, 5+5 31 | 1 | 22+9
. 11 | 5 | 11, 9+2, 8+3, 7+4, 6+5 32 | 0 | ./.
. 12 | 5 | 11+1, 9+3, 8+4, 7+5, 6+6 33 | 2 | 33, 22+11
. 13 | 4 | 11+2, 9+4, 8+5, 7+6 34 | 1 | 33+1
. 14 | 4 | 11+3, 9+5, 8+6, 7+7 35 | 1 | 33+2
. 15 | 3 | 11+4, 9+6, 8+7 36 | 1 | 33+3
. 16 | 3 | 11+5, 9+7, 8+8 37 | 1 | 33+4
. 17 | 2 | 11+6, 9+8 38 | 1 | 33+5
. 18 | 2 | 11+7, 9+9 39 | 1 | 33+6
. 19 | 1 | 11+8 40 | 1 | 33+7
. 20 | 1 | 11+9 41 | 1 | 33+8 .
PROG
(Haskell)
a260254 n = sum $ map (a136522 . (n -)) $
takeWhile (<= n `div` 2) a002113_list
Minimal number of palindromes in base 10 that add to n.
+10
12
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 1, 2, 2, 2, 2
COMMENTS
This sequence coincides with A088601 for n <= 301, but differs at n=302.
Although A088601 and this sequence agree for a large number of terms, because of their importance they warrant separate entries.
Cilleruelo and Luca prove that a(n) <= 3 (in fact they prove this for any fixed base g>=5). - Danny Rorabaugh, Feb 26 2016
LINKS
William D. Banks, Every natural number is the sum of forty-nine palindromes, INTEGERS 17 (2016), 9 pp.
PROG
(PARI) ispal(n)=my(d=digits(n)); d==Vecrev(d);
a(n)=my(L=n\2, d, e); if(ispal(n), return(1)); d=[1]; while((e=fromdigits(d))<=L, if(ispal(n-e), return(2)); my(k=#d, i=(k+1)\2); while(i&&d[i]==9, d[i]=0; d[k+1-i]=0; i--); if(i, d[i]++; d[k+1-i]=d[i], d=vector(#d+1); d[1]=d[#d]=1)); 3; \\ Charles R Greathouse IV, Nov 12 2018
Difference between n and the largest palindrome <= n.
+10
7
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
COMMENTS
Up to a(301), this is the same as the sequence b(n) = least palindrome to be subtracted from n such that the difference is again a palindrome, or 10 if no such palindrome exists. But a(302) = 10 (= 302 - 292), while b(302) = 111 is the smallest palindrome P such that 302 - P is again a palindrome, 302 - 111 = 191. Similarly, b(403) = ... = b(908) = 111. For n = 1011, 1012, ..., 1110 one has a(n) = n - 1001 = 10, 11, 12, ..., 109 while b(n) = 22, 11, 44, 55, ..., 99, b(1019) = 121, b(1020) = 101, b(1021) = 22, 33, ..., 99, b(1029) = 131, 101, 10, 33, 44, ... and so on. - M. F. Hasler, Sep 08 2015
A further sequence which starts with the same values is c(n) = n-p, where p is the largest palindrome <= n such that n-p is the sum of m-1 palindromes, where m = A261675(n) is the minimal number of palindromes that add up to n. This means that c(n) = 0 (= a(n) = b(n)) if n is a palindrome; if n is the sum of 2 palindromes, then c(n) = b(n) is the smallest palindrome such that n - c(n) is again a palindrome; if n is the sum of three palindromes, then c(n) is the smallest possible sum of two palindromes such that n - c(n) is the largest possible palindrome. The numbers with A261675(n) = 3 are listed in A035137. Here, n = 1099 is the first index for which c(n) = 100 (= 99 + 1 and 1099 - 100 = 999) differs from a(n) = n - 1001 = 98 and from b(n) = 10. - M. F. Hasler, Sep 11 2015
MAPLE
# P has list of palindromes
palfloor:=proc(n) global P; local i;
for i from 1 to nops(P) do
if P[i]=n then return(n); fi;
if P[i]>n then return(P[i-1]); fi;
od:
end;
[seq(n-palfloor(n), n=0..200)];
MATHEMATICA
palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; Table[k = n;
While[Nand[palQ@ k, k > -1], k--]; n - k, {n, 0, 86}] (* Michael De Vlieger, Sep 09 2015 *)
Not the difference of two palindromes (where 0 is considered a palindrome).
+10
6
1020, 1029, 1031, 1038, 1041, 1047, 1051, 1061, 1065, 1071, 1074, 1081, 1091, 1101, 1130, 1131, 1139, 1141, 1148, 1151, 1157, 1161, 1171, 1175, 1181, 1191, 1201, 1231, 1240, 1241, 1249, 1251, 1258, 1261, 1267, 1271, 1281, 1291, 1301, 1314, 1341, 1350
Positive palindromes that are not the sum of two positive palindromes.
+10
6
1, 111, 131, 141, 151, 161, 171, 181, 191, 1331, 1441, 1551, 1661, 1771, 1881, 1991, 10301, 10401, 10501, 10601, 10701, 10801, 10901, 11111, 11211, 11311, 11411, 11511, 11611, 11711, 11811, 11911, 12021, 12121, 12321, 12421, 12521, 12621, 12721, 12821
COMMENTS
These numbers do not occur in A035137.
EXAMPLE
22 is not a member because 22 = 11 + 11.
MAPLE
a:={}; M:=400; for n from 3 to M do p:=bP[n];
# is p a sum of two palindromes?
sw:=-1; for i from 2 to n-1 do j:=p-bP[i]; if digrev(j)=j then sw:=1; break; fi;
od;
if sw<0 then a:={op(a), p}; fi; od:
b:=sort(convert(a, list));
MATHEMATICA
lst1 = {}; lst2 = {}; r = 12821; Do[If[FromDigits@Reverse@IntegerDigits[n] == n, AppendTo[lst1, n]], {n, r}]; l = Length[lst1]; Do[s = lst1[[i]] + lst1[[j]]; AppendTo[lst2, s], {i, l - 1}, {j, i}]; Complement[lst1, lst2]
palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t1 = Select[Range[12900], palQ[#] &]; Complement[t1, Union[Flatten[Table[i + j, {i, t1}, {j, t1}]]]] (* Jayanta Basu, Jun 15 2013 *)
Nonnegative integers which cannot be obtained by adding exactly two nonzero decimal palindromes.
+10
5
0, 1, 21, 32, 43, 54, 65, 76, 87, 98, 111, 131, 141, 151, 161, 171, 181, 191, 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
COMMENTS
Every integer larger than two can be obtained by adding exactly three nonzero decimal palindromes.
The nonzero palindromes of this sequence are in A213879.
MAPLE
p:= proc(n) option remember; local i, s; s:= ""||n;
for i to iquo(length(s), 2) do if
s[i]<>s[-i] then return false fi od; true
end:
h:= proc(n) option remember; `if`(n<1, 0,
`if`(p(n), n, h(n-1)))
end:
b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i<n,
0, b(n, h(i-1), t)+b(n-i, h(min(n-i, i)), t-1)))
end:
g:= n-> (k-> b(n, h(n), k)-b(n, h(n), k-1))(2):
a:= proc(n) option remember; local j; for j from 1+
`if`(n=1, -1, a(n-1)) while g(j)<>0 do od; j
end:
seq(a(n), n=1..80);
Numbers n which are neither palindromes nor the sum of two palindromes, with property that subtracting the largest palindrome < n from n gives a number which is the sum of two palindromes.
+10
4
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, 1101, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1134, 1135, 1136, 1137, 1138, 1139, 1145, 1146, 1147, 1148, 1149, 1153
COMMENTS
These are the numbers with palindromic order 3 (see A261913).
More than the usual number of terms are shown in order to clarify the difference between this sequence and A035137.
Search completed in 0.015 seconds
|