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.

Showing 1-3 of 3 results.

A004087 Primes written backwards.

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 71, 91, 32, 92, 13, 73, 14, 34, 74, 35, 95, 16, 76, 17, 37, 97, 38, 98, 79, 101, 301, 701, 901, 311, 721, 131, 731, 931, 941, 151, 751, 361, 761, 371, 971, 181, 191, 391, 791, 991, 112, 322, 722, 922, 332, 932, 142, 152, 752, 362, 962, 172
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000040.

Programs

  • Haskell
    a004087 n = a004087_list !! (n-1)
    a004087_list = map a004086 a000040_list
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    [Seqint(Reverse(Intseq(NthPrime(n)))): n in [1..60]]; // Vincenzo Librandi, Jan 21 2016
    
  • Mathematica
    FromDigits[Reverse[IntegerDigits[#]]]&/@Prime[Range[100]] (* Vincenzo Librandi, Jul 05 2015 *)
  • Python
    from sympy import primerange
    print([int(str(p)[::-1]) for p in primerange(2, 272)]) # Michael S. Branicky, Jun 24 2022

Formula

a(n) = A004086(A000040(n)) = A000040(n) - A068396(n). - N. J. A. Sloane, Jun 29 2008
a(n) = A188649(A000040(n)). - Reinhard Zumkeller, Apr 11 2011
a(n) = A071786(A000040(n)). - Reinhard Zumkeller, Oct 14 2011

Extensions

More terms from Eric M. Schmidt, Apr 04 2014

A056965 a(n) = n - (reversal of digits of n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, -9, -18, -27, -36, -45, -54, -63, -72, 18, 9, 0, -9, -18, -27, -36, -45, -54, -63, 27, 18, 9, 0, -9, -18, -27, -36, -45, -54, 36, 27, 18, 9, 0, -9, -18, -27, -36, -45, 45, 36, 27, 18, 9, 0, -9, -18, -27, -36, 54, 45, 36, 27, 18, 9, 0, -9, -18, -27, 63, 54, 45, 36, 27, 18, 9, 0, -9, -18, 72, 63, 54
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

a(n) is a multiple of 9.

Examples

			a(17) = 17 - 71 = -54.
		

Crossrefs

Programs

  • Haskell
    a056965 n = n - a004086 n  -- Reinhard Zumkeller, Sep 17 2013
    
  • Maple
    a:= n-> (s-> n-parse(cat(s[-i]$i=1..length(s))))(""||n):
    seq(a(n), n=0..82);  # Alois P. Heinz, Jul 11 2021
  • Mathematica
    Table[n - FromDigits[Reverse[IntegerDigits[n]]], {n, 0, 82}] (* Jayanta Basu, Jul 11 2013 *)
  • PARI
    a(n) = n - fromdigits(Vecrev(digits(n))); \\ Michel Marcus, Dec 20 2023
  • Python
    def a(n): return n - int(str(n)[::-1]) # Osman Mustafa Quddusi, Jul 11 2021
    

Formula

a(n) = n - A004086(n) = 2*n - A056964(n).

A265326 n-th prime minus its binary reversal.

Original entry on oeis.org

1, 0, 0, 0, -2, 2, 0, -6, -6, 6, 0, -4, 4, -10, -14, 10, 4, 14, -30, -42, 0, -42, -18, 12, 30, 18, -12, 0, 18, 42, 0, -62, -8, -70, -20, -82, -28, -34, -62, -8, -26, 8, -62, 62, 34, -28, 8, -28, 28, 62, 82, -8, 98, 28, 0, -186, -84, -210, -60
Offset: 1

Views

Author

Max Barrentine, Dec 07 2015

Keywords

Comments

a(n) = 0 iff A000040(n) is in A016041. - Altug Alkan, Dec 07 2015
The graph consists of a succession of parallelograms. The parallelograms end when there is a long run of mostly positive terms followed by a long run of mostly negative terms. The places where the successive parallelograms end are the primes just before a power of 2: 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, ..., which are terms with indices 2, 4, 6, 11, 18, 31, 54, 97, 172, 309, 564, 1028, 1900, 3512, 6542, 12251, 23000, 43390, 82025, ... (see A014234 and A007053). - N. J. A. Sloane, May 29 2016

Examples

			n=5: prime(5) = 11_10 = 1011_2, reversing gives 1101_2 = 13_10, so a(5) = 11-13 = -2.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L, j;
      L:= convert(n,base,2);
      add(L[-j]*2^(j-1),j=1..nops(L))
    end proc:
    map(t -> t - revdigs(t),  select(isprime, [2,seq(i,i=3..1000,2)])); # Robert Israel, Dec 08 2015
  • Mathematica
    Table[# - FromDigits[Reverse@ IntegerDigits[#, 2], 2] &@ Prime@ n, {n, 60}] (* Michael De Vlieger, Dec 09 2015 *)
  • PARI
    a098957(n) = my(v=binary(prime(n)), s); forstep(i=#v, 1, -1, s+=s+v[i]); s
    a(n) = prime(n) - a098957(n); \\ Altug Alkan, Dec 07 2015

Formula

a(n) = A000040(n) - A098957(n).
a(n) = A055945(A000040(n)). - Michel Marcus, Dec 08 2015
Showing 1-3 of 3 results.