[go: up one dir, main page]

login
Search: a006960 -id:a006960
     Sort: relevance | references | number | modified | created      Format: long | short | data
The lower (or left) offset of a 196-iterate (A006960) from the largest palindrome less than the iterate.
+20
2
5, 9, 14, 99, 52, 89, 100, 407, 268, 10769, 10890, 99, 99, 4400, 8900, 9890, 10000, 97625, 1089, 3584, 99, 629882, 1099890, 10989, 926, 890000, 8491505, 10890099, 8229644, 9999989, 69923062, 10890000, 99099000, 43337905, 99990089, 962943454, 109890, 454649691
OFFSET
1,1
COMMENTS
When normalized over (0,1) by their respective palindrome-free interval about a 196-iterate, it has been empirically observed that the frequency distribution of this sequence appears to be quite symmetric about 0.5, as well as fractal when plotting the distribution over decreasing bin sizes.
The 196-iterates referred to here come from the reverse-and-add process generating A006960.
FORMULA
a(n) = A331560(n) - A331557(n).
EXAMPLE
The first term is 5 since 196-191 = 5
The second term is 9 since 887-878 = 9, etc.
MATHEMATICA
Map[Block[{k = # - 1}, While[k != IntegerReverse@ k, k--]; # - k] &, NestList[# + IntegerReverse[#] &, 196, 25]] (* brute force, or *)
Map[# - Block[{n = #, w, len, ww}, w = IntegerDigits[n]; len = Length@ w; ww = Take[w, Ceiling[len/2] ]; If[# < n, #, FromDigits@ Flatten@{#, If[OddQ@ len, Reverse@ Most@ #, Reverse@ #]} &@ If[Last@ ww == 0, MapAt[# - 1 &, Most@ ww, -1]~Join~{9}, MapAt[# - 1 &, ww, -1]]] &@ FromDigits@ Flatten@ {ww, If[OddQ@ len, Reverse@ Most@ ww, Reverse@ ww]}] &, NestList[# + IntegerReverse[#] &, 196, 37]] (* Michael De Vlieger, Jan 22 2020 *)
PROG
(Python)
# Slow Brute-force
n = 196
while n < 10**15:
m = n
while m != int(str(m)[::-1]): m+=-1
print(n-m, end=', ')
n = n + int(str(n)[::-1])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James D. Klein, Jan 20 2020
EXTENSIONS
More terms from Michael De Vlieger, Jan 22 2020
STATUS
approved
The upper (or right) offset of a 196-iterate (A006960) from the smallest palindrome greater than the iterate.
+20
2
6, 1, 96, 11, 48, 11, 10, 693, 732, 231, 110, 10901, 10901, 5600, 1100, 110, 1000, 12375, 108911, 96416, 99901, 470118, 110, 1089011, 999074, 110000, 2508495, 109901, 1770356, 11, 40076938, 99110000, 10901000, 56662095, 9911, 137056546, 1099890110, 545350309
OFFSET
1,1
COMMENTS
When normalized over (0,1) by their respective palindrome-free interval about a 196-iterate, it has been empirically observed that the frequency distribution of this sequence appears to be quite symmetric about 0.5, as well as fractal when plotting the distribution over decreasing bin sizes.
The 196-iterates referred to here come from the reverse-and-add process generating A006960.
FORMULA
a(n) = A331560(n) - A331556(n).
EXAMPLE
The first term is 6 since 202-196 = 6;
The second term is 1 since 888-887 = 1; etc.
PROG
(Python)
# Upper 196 offsets. Slow brute force
n = 196
while n < 10**15:
m = n
while m != int(str(m)[::-1]): m+=1
print(m-n)
n = n + int(str(n)[::-1])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James D. Klein, Jan 20 2020
EXTENSIONS
More terms from Jinyuan Wang, Feb 29 2020
STATUS
approved
Size of the palindrome-free intervals about the 196-iterates, A006960.
+20
2
11, 10, 110, 110, 100, 100, 110, 1100, 1000, 11000, 11000, 11000, 11000, 10000, 10000, 10000, 11000, 110000, 110000, 100000, 100000, 1100000, 1100000, 1100000, 1000000, 1000000, 11000000, 11000000, 10000000, 10000000, 110000000, 110000000, 110000000, 100000000
OFFSET
1,1
COMMENTS
By empirical observation, the integers in this sequence are of the form 10*10^n and 11*10^n, n >= 0, since they are the difference of consecutive palindromes surrounding the 196-iterates. (No differences of 2 observed.)
FORMULA
a(n) = A331556(n) + A331557(n).
EXAMPLE
191 < 196 < 202, 202 - 191 = 11;
878 < 887 < 888, 888 - 878 = 10; etc.
PROG
(Python)
# Palindrome-free interval about 196 offsets. Slow brute-force
n = 196
while n < 10**15:
m = n
while m != int(str(m)[::-1]): m+=1
s = m
m = n
while m != int(str(m)[::-1]): m-=1
print(s-m)
n = n + int(str(n)[::-1])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James D. Klein, Jan 20 2020
EXTENSIONS
a(31)-a(34) from Jinyuan Wang, Feb 29 2020
STATUS
approved
Palindromic deviation of terms of A006960.
+20
1
5, 1, 5, 2, 7, 2, 1, 14, 16, 11, 2, 2, 2, 8, 2, 2, 1, 14, 4, 14, 2, 28, 11, 20, 15, 2, 21, 13, 19, 2, 17, 11, 11, 27, 4, 32, 4, 37, 12, 12, 33, 2, 13, 28, 5, 49, 17, 47, 13, 43, 6, 39, 17, 44, 6, 45, 2, 35, 8, 37, 6, 69, 15, 47, 18, 48, 10, 33, 2, 59, 15, 19, 26, 17, 17, 73, 15, 55, 15, 63, 15, 43, 17, 12, 67, 10
OFFSET
0,1
COMMENTS
Apply the map n -> PD(n) = A064834(n) to the terms of A006960.
If 196 ever reaches a palindrome (which is an open problem), a(n) will become 0.
LINKS
KEYWORD
nonn
AUTHOR
W. W. Kokko, Mar 24 2013
STATUS
approved
a(n)..a(n+1)-1 are the indices in A323796 pointing to A006960(n) in the Reverse and Add! graph with 196 seed.
+20
1
1, 9, 13, 55, 103, 143, 183, 191, 431, 745, 1393
OFFSET
1,2
COMMENTS
This is a supporting sequence for A323796.
CROSSREFS
KEYWORD
base,more,nonn
AUTHOR
A.H.M. Smeets, Jan 28 2019
STATUS
approved
Length of n-th term in A006960.
+20
0
3, 3, 4, 4, 5, 5, 5, 6, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29
OFFSET
0,1
LINKS
Fred Gruenberger, How to handle numbers with thousands of digits, and why one might want to, Computer Recreations, Scientific American, 250 (No. 4, 1984), 19-26.
KEYWORD
nonn,base
AUTHOR
STATUS
approved
a(n) = n + reversal of digits of n.
+10
84
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 66, 77, 88, 99, 110
OFFSET
0,2
COMMENTS
If n has an even number of digits then a(n) is a multiple of 11.
Also called the Reverse and Add!, or RADD operation. Iteration of this function leads to the definition of Lychrel and related numbers, cf. A023108, A063048, A088753, A006960, and many others. - M. F. Hasler, Apr 13 2019
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..20000 (first 1001 terms from T. D. Noe)
Eric Weisstein's World of Mathematics, Reverse-Then-Add Sequence
FORMULA
a(n) = n + A004086(n) = 2*n - A056965(n).
n < a(n) < 11n for n > 0. - Charles R Greathouse IV, Nov 17 2022
EXAMPLE
a(17) = 17 + 71 = 88.
MATHEMATICA
Table[n+FromDigits[Reverse[IntegerDigits[n]]], {n, 0, 100}] (* Harvey P. Dale, Jul 19 2014 *)
PROG
(Haskell) a056964 n = n + a004086 n -- Reinhard Zumkeller, Oct 14 2011
(PARI) A056964(n)=fromdigits(Vecrev(digits(n)))+n \\ Charles R Greathouse IV, Oct 28 2014
(Python) def A056964(n): return n+int(str(n)[::-1]) # Indranil Ghosh, Jan 29 2017
CROSSREFS
Differs from A052008 when n=101 and a(101)=202 while A052008(101)=121
Cf. A036839.
KEYWORD
nonn,base,easy
AUTHOR
Henry Bottomley, Jul 18 2000
STATUS
approved
Positive integers which apparently never result in a palindrome under repeated applications of the function A056964(x) = x + (x with digits reversed).
+10
71
196, 295, 394, 493, 592, 689, 691, 788, 790, 879, 887, 978, 986, 1495, 1497, 1585, 1587, 1675, 1677, 1765, 1767, 1855, 1857, 1945, 1947, 1997, 2494, 2496, 2584, 2586, 2674, 2676, 2764, 2766, 2854, 2856, 2944, 2946, 2996, 3493, 3495, 3583, 3585, 3673, 3675
OFFSET
1,1
COMMENTS
196 is conjectured to be smallest initial term which does not lead to a palindrome. John Walker, Tim Irvin and others have extended this to millions of digits without finding one (see A006960).
Also called Lychrel numbers, though the definition of "Lychrel number" varies: Purists only call the "seeds" or "root numbers" Lychrel; the "related" or "extra" numbers (arising in the former's orbit) have been coined "Kin numbers" by Koji Yamashita. There are only 2 "root" Lychrels below 1000 and 3 more below 10000, cf. A088753. - M. F. Hasler, Dec 04 2007
Question: when do numbers in this sequence start to outnumber numbers that are not in the sequence? - J. Lowell, May 15 2014
Answer: according to Doucette's site, 10-digit numbers have 49.61% of Lychrels. So beyond 10 digits, Lychrels start to outnumber non-Lychrels. - Dmitry Kamenetsky, Oct 12 2015
From the current definition it is unclear whether palindromes are excluded from this sequence, cf. A088753 vs A063048. 9999 would be the first palindromic term that will never result in a palindrome when the Reverse-then-add function A056964 is repeatedly applied. - M. F. Hasler, Apr 13 2019
REFERENCES
Daniel Lignon, Dictionnaire de (presque) tous les nombres entiers, Ellipses, Paris, 2012, 702 pages. See Entry 196.
LINKS
A.H.M. Smeets, Table of n, a(n) for n = 1..20000 (tested for 200 iterations; first 249 terms from William Boyles)
DeCode, Lychrel Number, dCode.fr 'toolkit' to solve games, riddles, geocaches, 2020.
Jason Doucette, World Records
Martianus Frederic Ezerman, Bertrand Meyer and Patrick Sole, On Polynomial Pairs of Integers, arXiv:1210.7593 [math.NT], 2012-2014.
Patrick De Geest, Some thematic websources
James Grime and Brady Haran, What's special about 196?, Numberphile video (2015).
Fred Gruenberger, How to handle numbers with thousands of digits, and why one might want to, Computer Recreations, Scientific American, 250 (No. 4, 1984), 19-26.
R. K. Guy, What's left?, Math Horizons, Vol. 5, No. 4 (April 1998), pp. 5-7.
Niphawan Phoopha and Prapanpong Pongsriiam, Notes on 1089 and a Variation of the Kaprekar Operator, Int'l J. Math. Comp. Sci. (2021) Vol. 16, No. 4, 1599-1606.
Wade VanLandingham, 196 and other Lychrel numbers
Wade VanLandingham, Largest known Lychrel number
Eric Weisstein's World of Mathematics, 196 Algorithm.
Eric Weisstein's World of Mathematics, Palindromic Number Conjecture
Eric Weisstein's World of Mathematics, Lychrel Number
EXAMPLE
From M. F. Hasler, Feb 16 2020: (Start)
Under the "add reverse" operation, we have:
196 (+ 691) -> 887 (+ 788) -> 1675 (+ 5761) -> 7436 (+ 6347) -> 13783 (+ 38731) -> etc. which apparently never leads to a palindrome.
Similar for 295 (+ 592) -> 887, 394 (+ 493) -> 887, 790 (+ 097) -> 887 and 689 (+ 986) -> 1675, which all merge immediately into the above sequence, and also for the reverse of any of the numbers occurring in these sequences: 493, 592, 691, 788, ...
879 (+ 978) -> 1857 -> 9438 -> 17787 -> 96558 is the only other "root" Lychrel below 1000 which yields a sequence distinct from that of 196. (End)
MATHEMATICA
With[{lim = 10^3}, Select[Range@ 4000, Length@ NestWhileList[# + IntegerReverse@ # &, #, ! PalindromeQ@ # &, 1, lim] == lim + 1 &]] (* Michael De Vlieger, Dec 23 2017 *)
PROG
(PARI) select( {is_A023108(n, L=exponent(n+1)*5)=while(L--&& n*2!=n+=A004086(n), ); !L}, [1..3999]) \\ with {A004086(n)=fromdigits(Vecrev(digits(n)))}; default value for search limit L chosen according to known records A065199 and indices A065198. - M. F. Hasler, Apr 13 2019, edited Feb 16 2020
CROSSREFS
Cf. A056964 ("reverse and add" operation on which this is based).
KEYWORD
nonn,base,nice
EXTENSIONS
Edited by M. F. Hasler, Dec 04 2007
STATUS
approved
Start with n; if palindrome, stop; otherwise add to itself with digits reversed; a(n) gives palindrome at which it stops, or -1 if no palindrome is ever reached.
+10
43
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 33, 44, 55, 66, 77, 88, 99, 121, 22, 33, 22, 55, 66, 77, 88, 99, 121, 121, 33, 44, 55, 33, 77, 88, 99, 121, 121, 363, 44, 55, 66, 77, 44, 99, 121, 121, 363, 484, 55, 66, 77, 88, 99, 55, 121, 363, 484, 1111, 66, 77, 88, 99, 121, 121, 66, 484, 1111, 4884, 77, 88, 99, 121, 121, 363, 484, 77, 4884, 44044, 88
OFFSET
0,3
COMMENTS
It is believed that a(196) = -1.
REFERENCES
M. Donner, I Love Me, Vol. I: S. Wordrow's palindromic encyclopedia (Algonquin Books, 1996) p. 268
LINKS
O. Forster, ARIBAS
Eric Weisstein's World of Mathematics, 196-Algorithm.
EXAMPLE
19 -> 19 + 91 = 110 -> 110 + 011 = 121, so a(19) = 121.
MATHEMATICA
Table[NestWhile[# + FromDigits[Reverse[IntegerDigits[#]]] &, n, IntegerDigits[#] != Reverse[IntegerDigits[#]] &], {n, 0, 90}] (* Harvey P. Dale, Dec 18 2011 *)
PROG
(ARIBAS): var st: stack; end; for k := 0 to 60 do n := k; while n <> int_reverse(n) do n := n + int_reverse(n); end; stack_push(st, n); end; stack2array(st).
(PARI) a(n)=my(k); while((k=fromdigits(Vecrev(digits(n)))) != n, n += k); n \\ infinite loop if a(n) = -1; Charles R Greathouse IV, Dec 13 2015
CROSSREFS
Cf. A061563, A016016, A023109, A006960, A023108, A002113, A033665 (number of steps).
KEYWORD
nonn,base,nice
EXTENSIONS
More terms from Jenise Smalley (neicey01(AT)hotmail.com), Oct 18 2001
STATUS
approved
a(0) = 0. For n > 0, smallest non-palindromic number k such that the smallest palindrome in the Reverse and Add! trajectory of k is reached after exactly n iterations.
+10
35
0, 10, 19, 59, 69, 166, 79, 188, 193, 1397, 829, 167, 2069, 1797, 849, 177, 1496, 739, 1798, 10777, 6999, 1297, 869, 187, 89, 10797, 10853, 10921, 10971, 13297, 10548, 13293, 17793, 20889, 700269, 106977, 108933, 80359, 13697, 10794, 15891, 1009227, 1007619, 1009246, 1008628, 600259, 131996, 70759, 1007377, 1001699, 600279, 141996, 70269, 10677, 10833, 10911
OFFSET
0,2
COMMENTS
From Felix Fröhlich, May 28 2022: (Start)
Variant of A015994 not allowing palindromes as starting values.
Smallest non-palindromic k such that A033665(k) = n. (End)
LINKS
MATHEMATICA
Table[ SelectFirst[Range[0, 20000], (np = #; i = 0;
While[ ! PalindromeQ[np] && i <= n, np = np + IntegerReverse[np];
i++]; i == n ) &] , {n, 0, 32}] (* Robert Price, Oct 16 2019 *)
PROG
(PARI)
rev(n)={d=digits(n); p=""; for(i=1, #d, p=concat(Str(d[i]), p)); return(eval(p))}
nbs(n)=if(n==rev(n), return(0)); for(k=1, 10^3, i=n+rev(n); if(rev(i)==i, return(k)); n=i) \\ A033665
a(n)=for(k=1, 10^8, if(nbs(k)==n, return(k)))
n=0; while(n<100, print1(a(n), ", "); n++) \\ Derek Orr, Jul 28 2014
(Python)
def A023109(n):
if n > 0:
k = 0
while True:
m = k
for i in range(n):
if str(m) == str(m)[::-1]:
break
m += int(str(m)[::-1])
else:
if str(m) == str(m)[::-1]:
return k
k += 1
else:
return 0
# Chai Wah Wu, Feb 08 2015
(PARI) revadd(n) = n+eval(concat(Vecrev(Str(n))))
iterationstosmallestpalindrome(n, bound) = my(x=n, i=0, d); while(1, if(i > bound, return(-1)); x=revadd(x); i++; d=digits(x); if(d==Vecrev(d), return(i)))
a(n) = if(n==0, return(0)); for(k=1, oo, my(d=digits(k)); if(d!=Vecrev(d), if(iterationstosmallestpalindrome(k, n)==n, return(k)))) \\ Felix Fröhlich, May 28 2022
CROSSREFS
KEYWORD
nonn,base,nice
EXTENSIONS
a(41)-a(55) verified and added by Aldo González Lorenzo, May 15 2011
Name edited by Felix Fröhlich, May 28 2022
STATUS
approved

Search completed in 0.033 seconds