[go: up one dir, main page]

login
Search: a015976 -id:a015976
     Sort: relevance | references | number | modified | created      Format: long | short | data
Palindromes obtained after one iteration of Reverse and Add applied to the terms of A015976.
+20
0
2, 4, 6, 8, 11, 22, 33, 44, 55, 66, 77, 88, 99, 22, 33, 44, 55, 66, 77, 88, 99, 121, 33, 44, 55, 66, 77, 88, 99, 121, 44, 55, 66, 77, 88, 99, 121, 55, 66, 77, 88, 99, 121, 66, 77, 88, 99, 121, 77
OFFSET
2,1
MATHEMATICA
Select[(FromDigits[#] + FromDigits[Reverse[#]]) & /@ IntegerDigits[Range[1000]], IntegerDigits[#] == Reverse[IntegerDigits[#]] &]
CROSSREFS
Cf. A015976 (One iteration of Reverse and Add is needed to reach a palindrome).
KEYWORD
nonn,base
AUTHOR
Morgan L. Owens, Nov 21 2014
STATUS
approved
One 'Reverse and Add' step is needed to reach a palindrome.
+10
14
10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 38, 40, 41, 42, 43, 45, 47, 50, 51, 52, 53, 54, 56, 60, 61, 62, 63, 65, 70, 71, 72, 74, 80, 81, 83, 90, 92, 100, 102, 103, 104, 105, 106, 107, 108, 110, 112, 113, 114, 115, 116, 117
OFFSET
1,1
COMMENTS
The number of steps starts at 0, so palindromes (A002113) are excluded.
MATHEMATICA
Select[Range[10, 120], !PalindromeQ[#]&&PalindromeQ[#+IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 14 2017 *)
PROG
(ARIBAS): function revadd_steps(k, stop: integer); var c, n, m, steps, rev: integer; begin n := 0; c := 0; while c < stop do m := n; rev := int_reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := int_reverse(m); inc(steps); end; if steps = k and m = rev then write(n, " "); inc(c); end; inc(n); end; end; revadd_steps(1, 66).
(PARI) Rev(x)= { local(d, r=0); while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) } digitsIn(x)= { local(d); if (x==0, return(1)); d=1 + log(x)\log(10); if (10^d == x, d++, if (10^(d-1) > x, d--)); return(d) } Palin(x)= { local(d, e, f, i, t, y); if (x==0, return(1)); y=x; d=digitsIn(x); t=10^(d - 1); for (i=1, d\2, f=y-10*(y\10); y\=10; e=x\t; x-=t*e; t/=10; if (e!=f, return(0)) ); return(1) } { n=0; for (m = 0, 10^9, if (!Palin(m) && Palin(Rev(m) + m), write("b065206.txt", n++, " ", m); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 13 2009
(Haskell)
a065206 n = a065206_list !! (n-1)
a065206_list = filter ((== 1) . a136522 . a056964) a029742_list
-- Reinhard Zumkeller, Oct 14 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Klaus Brockhaus, Oct 21 2001
EXTENSIONS
Offset corrected by Harry J. Smith, Oct 13 2009
STATUS
approved
Primes p such that p + (p reversed) is a palindrome.
+10
1
2, 3, 11, 13, 17, 23, 29, 31, 41, 43, 47, 53, 61, 71, 83, 101, 103, 107, 113, 127, 131, 137, 211, 223, 227, 233, 241, 311, 313, 331, 401, 421, 431, 433, 443, 503, 521, 523, 541, 601, 613, 631, 641, 643, 701, 811, 821, 1013, 1021, 1031, 1033, 1051, 1061, 1063
OFFSET
1,1
COMMENTS
Palindrome is also a prime for n = 241, 443, 613, 641, 811, 20011, 20047, 20051, 20101, 20161, ... . Example: 613+316 = 929, which is prime. [Bruno Berselli, Jul 05 2014]
Subsequence of primes within A015976. - Michel Marcus, Jul 05 2014
EXAMPLE
13 is in the sequence because 13+31 = 44 is a palindrome.
1103 is in the sequence because 1103+3011 = 4114 is a palindrome.
MATHEMATICA
selQ[p_] := (id = IntegerDigits[p]; id2 = IntegerDigits[p + FromDigits[Reverse[id]]]; id2 == Reverse[id2]); Select[Array[Prime, 200], selQ] (* Jean-François Alcover, Jul 05 2014 *)
Select[Prime[Range[200]], PalindromeQ[#+IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 11 2020 *)
PROG
(Magma) [p: p in PrimesUpTo(1200) | q eq Reverse(q) where q is Intseq(p+Seqint(Reverse(Intseq(p))))]; // Bruno Berselli, Jul 05 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vincenzo Librandi, Jul 02 2014
STATUS
approved
a(n) and at least one distinct anagram of a(n) that doesn't start with a leading 0 sum up to a palindrome.
+10
1
12, 13, 14, 15, 16, 17, 18, 21, 23, 24, 25, 26, 27, 29, 31, 32, 34, 35, 36, 38, 41, 42, 43, 45, 47, 51, 52, 53, 54, 56, 61, 62, 63, 65, 71, 72, 74, 81, 83, 92, 102, 103, 104, 105, 106, 107, 108, 112, 113, 114, 115, 116, 117, 118, 120, 122, 123, 124, 125, 126, 127, 128, 132, 133, 134, 135, 136, 137, 138, 142
OFFSET
1,1
LINKS
EXAMPLE
10 is not in the sequence although 10 + 01 = 11 because 01 starts with a leading 0;
11 is not in the sequence although 11 + 11 = 22 because the second 11 is not distinct from the first one;
12 is in the sequence as 12 + 21 = 33. Etc.
PROG
(PARI) See Links section.
CROSSREFS
Cf. A002113, A015976 ("Reverse and add").
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Jan 12 2020
STATUS
approved
Numbers k that can be added without carries to their digit reversal (A004086(k)).
+10
0
0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 40, 41, 42, 43, 44, 45, 50, 51, 52, 53, 54, 60, 61, 62, 63, 70, 71, 72, 80, 81, 90, 100, 101, 102, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113
OFFSET
1,3
COMMENTS
All positive terms belong to A015976.
EXAMPLE
42 belongs to the sequence as 42 + 24 does not lead to carries.
48 does not belong to the sequence as 48 + 84 leads to carries.
PROG
(PARI) is(n, base = 10) = { my (d = if (n, digits(n, base), [0]), p = d + Vecrev(d)); vecmax(p) < base }
CROSSREFS
Cf. A004086, A015976, A056964, A140900 (base-2 analog).
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Mar 03 2024
STATUS
approved

Search completed in 0.006 seconds