login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A261424 Difference between n and the largest palindrome <= n. 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,14
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
LINKS
FORMULA
a(n) = n - A261423(n). - 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 *)
CROSSREFS
Sequence in context: A090175 A275010 A010880 * A097462 A210944 A259434
KEYWORD
nonn,base,look
AUTHOR
N. J. A. Sloane, Aug 28 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 30 08:24 EDT 2024. Contains 372127 sequences. (Running on oeis4.)