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-2 of 2 results.

A053063 Pendulum numbers: alternately append n to beginning or end of previous term.

Original entry on oeis.org

1, 21, 213, 4213, 42135, 642135, 6421357, 86421357, 864213579, 10864213579, 1086421357911, 121086421357911, 12108642135791113, 1412108642135791113, 141210864213579111315, 16141210864213579111315, 1614121086421357911131517, 181614121086421357911131517, 18161412108642135791113151719
Offset: 1

Views

Author

Felice Russo, Feb 25 2000

Keywords

Comments

Comments from N. J. A. Sloane, Dec 07 2019: (Start)
Eric Angelini and Kay Rosen suggest these could be called Pnuumlde numbers.
Eric Angelini asks if any term is a prime.
James R. Buddenhagen finds that the first prime is a(121), a 255-digit prime according to Maple.
Hans Havermann finds that there is one more prime in the first 10000 terms, a(1399), which is a 4489-digit prime.
(End)
The third prime in the sequence is a(40714) with 192464 decimal digits. The terms at even indices are duplicated by the even-indexed terms of A281254, which is why this term is a prime for both sequences. - Hans Havermann, Jan 16 2020

Crossrefs

See A281254 for another version.

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,If[OddQ[n],(n+1)*10^IntegerLength[a]+a,a*10^IntegerLength[ n+1]+ n+1]}; NestList[nxt,{1,1},30][[All,2]] (* Harvey P. Dale, Jul 20 2022 *)
  • PARI
    lista(nn) = {print1(val=1, ", "); b = 0; for (n=2, nn, if (b, val = concat(Str(val), Str(n)), val = concat(Str(n), Str(val))); print1(val, ", "); b = 1 - b;);} \\ Michel Marcus, Aug 11 2017

Extensions

More terms from Michel Marcus, Aug 11 2017

A281253 Alternately concatenate the decimal digits from front to back 1...n such that n is always to the right.

Original entry on oeis.org

1, 12, 213, 3124, 42135, 531246, 6421357, 75312468, 864213579, 97531246810, 1086421357911, 119753124681012, 12108642135791113, 1311975312468101214, 141210864213579111315, 15131197531246810121416, 1614121086421357911131517
Offset: 1

Views

Author

Robert G. Wilson v, Jan 18 2017

Keywords

Comments

a(n) is prime for n: 121, 1399 and no others < 3000.

Examples

			a(13) = 12108642135791113.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) b(n):= `if`(n=1, 1, parse(cat(n, a(n-1)))) end:
    a:= proc(n) a(n):= `if`(n=1, 1, parse(cat(b(n-1), n))) end:
    seq(a(n), n=1..20);  # Alois P. Heinz, Jan 18 2017
  • Mathematica
    f[n_] := Fold[ If[ Mod[n +#2, 2] == 0, #1, #2]*10^IntegerLength@ If[ Mod[n +#2, 2] == 0, #2, #1] +If[ Mod[n +#2, 2] == 0, #2, #1] &, 0, Range@ n]; Array[f, 17]
  • Python
    def a(n):
        if n==1:
            return ["1"]
        return a(n-1)[::-1]+[str(n)]
    def A281253(n):
        return "".join(a(n)) # Indranil Ghosh, Jan 27 2017
Showing 1-2 of 2 results.