cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 21-30 of 83 results. Next

A072366 Numbers x such that x + reverse of x is a prime.

Original entry on oeis.org

1, 10, 100, 116, 118, 140, 142, 146, 158, 166, 170, 172, 178, 182, 188, 190, 196, 215, 217, 229, 239, 241, 245, 257, 265, 269, 271, 277, 281, 287, 295, 299, 314, 316, 328, 338, 340, 344, 356, 364, 368, 370, 376, 380, 386, 394, 398, 413, 415, 427, 437, 439
Offset: 1

Views

Author

Shyam Sunder Gupta, Jul 18 2002

Keywords

Examples

			116 is a term because 116+611=727 is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], PrimeQ[ # + FromDigits[Reverse[IntegerDigits[ # ]]]] &] (* Tanya Khovanova, Jul 23 2007 *)
  • PARI
    isok(n) = isprime(n+subst(Polrev(digits(n)), x, 10)); \\ Michel Marcus, Nov 29 2014

A055948 n + reversal of base 4 digits of n (written in base 10).

Original entry on oeis.org

0, 2, 4, 6, 5, 10, 15, 20, 10, 15, 20, 25, 15, 20, 25, 30, 17, 34, 51, 68, 25, 42, 59, 76, 33, 50, 67, 84, 41, 58, 75, 92, 34, 51, 68, 85, 42, 59, 76, 93, 50, 67, 84, 101, 58, 75, 92, 109, 51, 68, 85, 102, 59, 76, 93, 110, 67, 84, 101, 118, 75, 92, 109, 126, 65, 130, 195
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

If n has an even number of digits in base 4 then a(n) is a multiple of 5.

Crossrefs

Cf. A035524 (iterated).

Programs

  • Haskell
    a055948 n = n + a030103 n
    -- Reinhard Zumkeller, Oct 10 2011
  • Mathematica
    Table[n+FromDigits[Reverse[IntegerDigits[n,4]],4],{n,0,70}] (* Harvey P. Dale, Nov 24 2021 *)

Formula

a(n) = n + A030103(n).

A063433 'Reverse and Add!' trajectory of 10577.

Original entry on oeis.org

10577, 88078, 175166, 836737, 1574375, 7309126, 13528163, 49710694, 99312488, 187733887, 976071668, 1842242347, 9274664828, 17559329557, 93151725128, 175304440267, 937348843838, 1775697687577, 9533565653348, 17967131306707
Offset: 0

Views

Author

Klaus Brockhaus, Jul 20 2001

Keywords

Examples

			a(1) = 10577 + 77501 = 88078.
		

Crossrefs

Programs

  • ARIBAS
    m := 10577; stop := 20; c := 0; rev := int_reverse(m); while m <> rev and c < stop do inc(c); write(m," "); m := m + rev; rev := int_reverse(m); end;
    
  • Haskell
    a063433 n = a063433_list !! n
    a063433_list = iterate a056964 10577 -- Reinhard Zumkeller, Sep 22 2011
  • Mathematica
    NestList[#+FromDigits[Reverse[IntegerDigits[#]]]&,10577, 20]  (* Harvey P. Dale, Apr 03 2011 *)
  • PARI
    Rev(x)= { local(d,r); r=0; while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) }
    { for (n=0, 200, if (n, a+=Rev(a), a=10577); write("b063433.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 21 2009
    

A345111 a(n) = n + A345110(n).

Original entry on oeis.org

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
Offset: 0

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

First differs from both A052008 and A056964 at n = 101.

Examples

			For n = 101: 101 + A345110(101) = 101 + 11 = 112, so a(101) = 112.
		

Crossrefs

Programs

  • Mathematica
    Array[#+FromDigits@RotateLeft@IntegerDigits@#&,100,0] (* Giorgos Kalogeropoulos, Jun 09 2021 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a(n) = n + eva(rot(digits(n)))
    
  • Python
    def rotl(s): return s[1:] + s[0]
    def a(n): return n + int(rotl(str(n)))
    print([a(n) for n in range(63)]) # Michael S. Branicky, Jun 09 2021

A345114 Numbers whose trajectories under the map x -> A345111(x) do not reach a palindrome (conjectured).

Original entry on oeis.org

49, 58, 59, 67, 68, 69, 76, 77, 78, 79, 85, 86, 87, 88, 94, 95, 96, 97, 103, 114, 115, 116, 117, 119, 121, 124, 125, 126, 128, 129, 131, 134, 135, 137, 138, 139, 141, 142, 143, 146, 148, 149, 151, 153, 154, 155, 157, 158, 159, 160, 161, 162, 163, 164, 165, 168
Offset: 1

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

The trajectories of the given terms do not reach a palindrome in 10000 (10^4) or fewer steps. The trajectory of 49 does not reach a palindrome in 100000 (10^5) or fewer steps.

Crossrefs

Cf. A023108 (analog for the map x -> A056964(x)), A345110, A345111, A345112, A345113, A345115.

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a345112(n, bound) = my(x=n, i=0); while(1, x=x+eva(rot(digits(x))); i++; if(digits(x)==Vecrev(digits(x)), break); if(i > bound, return(-1))); i
    is(n) = a345112(n, 10000)==-1
    
  • Python
    def pal(s): return s == s[::-1]
    def rotl(s): return s[1:] + s[0]
    def A345111(n): return n + int(rotl(str(n)))
    def A345112_bd(n, bd=10000):
        i, iter, seen = 0, n, set()
        while not (iter > n and pal(str(iter))) and iter not in seen and i < bd:
            seen.add(iter)
            i, iter = i+1, A345111(iter)
        return i if iter > n and pal(str(iter)) else 0
    def aupto(lim, bd=10000):
        return [n for n in range(1, lim+1) if A345112_bd(n, bd=bd) == 0]
    print(aupto(168, bd=100)) # Michael S. Branicky, Jun 09 2021

A349239 a(n) = n + (reversal of digits in the Zeckendorf representation of n).

Original entry on oeis.org

0, 2, 3, 4, 8, 6, 12, 11, 9, 18, 16, 15, 24, 14, 28, 24, 22, 36, 22, 36, 32, 22, 44, 37, 33, 55, 32, 54, 47, 33, 55, 48, 44, 66, 35, 70, 58, 51, 86, 48, 83, 71, 48, 83, 71, 64, 99, 51, 86, 74, 67, 102, 64, 99, 87, 56, 112, 92, 80, 136, 74, 130, 110, 72, 128, 108
Offset: 0

Views

Author

Kevin Ryde, Nov 11 2021

Keywords

Crossrefs

Cf. A189920 (Zeckendorf digits), A349238 (reverse), A349240 (reverse and subtract), A348570 (Lychrels).
Other bases: A055944 (binary), A056964 (decimal).

Programs

  • PARI
    \\ See links.
    
  • Python
    # Using functions NumToFib and RevFibToNum from A349238.
    n, a = 0, 0
    print(a + a, end = ", ")
    while n < 65:
        n += 1
        print(n + RevFibToNum(NumToFib(n)), end = ", ") # A.H.M. Smeets, Nov 14 2021

Formula

a(n) = n + A349238(n).
a(n) = 2*n - A349240(n).

A063051 'Reverse and Add!' trajectory of 879.

Original entry on oeis.org

879, 1857, 9438, 17787, 96558, 182127, 903408, 1707717, 8884788, 17759676, 85455447, 159910905, 668930856, 1326970722, 3597766953, 7194444906, 13288889823, 46187778054, 91275556218, 172541113437, 906852258708
Offset: 0

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Examples

			a(1) = 879 + 978 = 1857.
		

Crossrefs

Programs

  • ARIBAS
    m := 879; stop := 25; c := 0; rev := int_reverse(m); while m <> rev and c < stop do inc(c); write(m," "); m := m + rev; rev := int_reverse(m); end;
    
  • Haskell
    a033651 n = a033651_list !! n
    a033651_list = iterate a056964 9 -- Reinhard Zumkeller, Sep 22 2011
  • Mathematica
    NestList[# + FromDigits[Reverse[IntegerDigits[#]]]&, 879, 40] (* Vincenzo Librandi, Sep 23 2013 *)
  • PARI
    Rev(x)= { local(d); r=0; while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) }
    { for (n=0, 200, if (n, a+=Rev(a), a=879); write("b063051.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 16 2009
    

A063057 'Reverse and Add!' trajectory of 7059.

Original entry on oeis.org

7059, 16566, 83127, 155265, 717816, 1336533, 4692864, 9375828, 17661567, 94178238, 177465387, 961030158, 1812060327, 9042662508, 17095324917, 89037683988, 177976357086, 858730036857, 1617360074715, 6792060711876
Offset: 0

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Examples

			a(1) = 7059 + 9507 = 16566.
		

Crossrefs

Programs

  • ARIBAS
    m := 7059; stop := 25; c := 0; rev := int_reverse(m); while m <> rev and c < stop do inc(c); write(m," "); m := m + rev; rev := int_reverse(m); end;
    
  • Haskell
    a063057 n = a063057_list !! n
    a063057_list = iterate a056964 7059 -- Reinhard Zumkeller, Sep 22 2011
  • Mathematica
    NestList[# + FromDigits[Reverse[IntegerDigits[#]]]&, 7059, 40] (* Vincenzo Librandi, May 03 2014 *)

A256756 a(n) = bitwise XOR of n and the reverse of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 25, 18, 39, 60, 45, 86, 67, 72, 22, 25, 0, 55, 50, 45, 36, 83, 78, 65, 29, 18, 55, 0, 9, 22, 27, 108, 117, 122, 44, 39, 50, 9, 0, 27, 110, 101, 100, 111, 55, 60, 45, 22, 27, 0, 121, 114, 111, 100, 58, 45, 36, 27, 110, 121
Offset: 0

Views

Author

Alois P. Heinz, Apr 09 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> Bits[Xor](n, (s-> parse(cat(s[-i]$i=1..length(s))))(""||n)):
    seq(a(n), n=0..80);
  • Mathematica
    Table[BitXor[n,FromDigits[Reverse[IntegerDigits[n]]]],{n,0,65}] (* Ivan N. Ianakiev, Apr 10 2015 *)
  • PARI
    a(n) = bitxor(n, subst(Polrev(digits(n)), x, 10)); \\ Michel Marcus, Apr 10 2015

Formula

a(n) = A003987(n, A004086(n)).

A367796 Primes p such that the sum of p and its reversal is the square of a prime.

Original entry on oeis.org

2, 29, 47, 83, 20147, 23117, 24107, 63113, 80141, 81131, 261104399, 262005299, 262104299, 262203299, 263302199, 264203099, 264302099, 264500099, 270401489, 271500389, 273104189, 273302189, 274401089, 282203279, 284302079, 284500079, 291104369, 291203369, 292005269, 293005169, 293104169, 294302069
Offset: 1

Views

Author

Robert Israel, Nov 30 2023

Keywords

Comments

Terms > 83 have an odd number of digits and an even first digit.

Examples

			A056964(a(n)) = 121 = 11^2 for 2 <= n <= 4.
A056964(a(n)) = 94249 = 307^2 for 5 <= n <= 10.
A056964(a(n)) = 1254505561 = 35419^2 for 11 <= n <= 71.
		

Crossrefs

Cf. A056964, A067030, A061783. Subset of A367793.

Programs

  • Maple
    digrev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    filter:= proc(t) local v;
      v:= sqrt(t+digrev(t));
      v::integer and isprime(v)
    end proc:
    R:= 2, 29, 47, 83: count:= 4: flag:= true:
    for d from 3 to 9 by 2 do
      p:= prevprime(10^(d-1));
      for i from 1 do
        p:= nextprime(p);
        p1:= floor(p/10^(d-1));
        if p1::odd then p:= nextprime((p1+1)*10^(d-1)) fi;
        if p > 10^d then break fi;
        if filter(p) then
           count:= count+1; R:= R,p;
    fi od od:
    R;
  • Mathematica
    Select[Prime[Range[10^6]], PrimeQ[Sqrt[#+FromDigits[Reverse[IntegerDigits[#]]]]] &] (* Stefano Spezia, Dec 10 2023 *)
  • PARI
    \\ See PARI link
Previous Showing 21-30 of 83 results. Next