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.

User: George Bull

George Bull's wiki page.

George Bull has authored 2 sequences.

A346756 Lesser emirps (A109308) subtracted from their reversals.

Original entry on oeis.org

18, 54, 36, 18, 594, 198, 792, 594, 594, 792, 792, 396, 396, 594, 594, 198, 198, 198, 7992, 180, 270, 2268, 540, 8532, 810, 6804, 1908, 7902, 360, 2358, 630, 2718, 1908, 5904, 1998, 7992, 90, 6084, 8172, 8262, 8442, 2538, 450, 8532, 7632, 7812, 7902, 2088, 270
Offset: 1

Author

George Bull, Aug 20 2021

Keywords

Examples

			31 - 13 = 18, 71 - 17 = 54, 73 - 37 = 36 (distance between lesser emirps and their reversals).
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L));
    end proc:
    f:= proc(p) local r;
      if not isprime(p) then return NULL fi;
      r:= rev(p);
      if r > p and isprime(r) then r-p else NULL fi
    end proc:
    map(f, [seq(i,i=11 .. 10^4, 2)]); # Robert Israel, Dec 28 2023
  • Mathematica
    f[n_] := IntegerReverse[n] - n; Map[f, Select[Range[1500], f[#] > 0 && PrimeQ[#] && PrimeQ @ IntegerReverse[#] &]] (* Amiram Eldar, Sep 08 2021 *)
  • PARI
    rev(p) = fromdigits(Vecrev(digits(p))); \\ A004086
    lista(nn) = {my(list = List()); forprime (p=1, nn, my(q=rev(p)); if ((q>p) && isprime(q), listput(list, q-p));); Vec(list);} \\ Michel Marcus, Sep 07 2021
    
  • Python
    from sympy import isprime, nextprime
    def aupton(terms):
        alst, p = [], 2
        while len(alst) < terms:
            revp = int(str(p)[::-1])
            if p < revp and isprime(revp):
                alst.append(revp - p)
            p = nextprime(p)
        return alst
    print(aupton(49)) # Michael S. Branicky, Sep 08 2021

Formula

a(n) = reverse(A109308(n)) - A109308(n).

Extensions

Better name and more terms from Jon E. Schoenfield, Aug 20 2021

A345143 Reflection of the concatenation of the previous two terms minus the previous term.

Original entry on oeis.org

0, 1, 9, 82, 207, 70021, 11937681, 1867379174326, 623471971900739499585, 5859949370091168271294333980238096, 6908320893334921728606040790129494417723642675198936230
Offset: 0

Author

George Bull, Jun 09 2021

Keywords

Examples

			a(4) = 207 since 28(9) - 82 = 207.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n, (s-> parse(cat(seq(
          s[-i], i=1..length(s))))-a(n-1))(cat("", a(n-2), a(n-1))))
        end:
    seq(a(n), n=0..11);  # Alois P. Heinz, Jun 11 2021
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = FromDigits[Join @@ (Reverse @ IntegerDigits[#] & /@ {a[n - 1], a[n - 2]})] - a[n - 1]; Array[a, 11, 0] (* Amiram Eldar, Jun 09 2021 *)
  • Python
    def f(v): return int((str(v[-2])+str(v[-1]))[::-1]) - v[-1]
    def aupton(nn):
        alst = [0, 1]
        for n in range(2, nn+1): alst.append(f(alst))
        return alst[:nn+1]
    print(aupton(10)) # Michael S. Branicky, Jun 09 2021

Formula

a(n) = A004086(a(n-2)||a(n-1)) - a(n-1) for n >= 2, a(n) = n for n <= 1.