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

A350153 Prime numbers created by concatenating all numbers 1 through k for some k > 1, then continuing to concatenate all numbers from k-1 towards 1. Primes are added to the sequence as they are found as k increases.

Original entry on oeis.org

12343, 1234543, 12345678910987, 12345678910987654321, 12345678910111213141516171819202122212019181716151413, 12345678910111213141516171819202122232425262728293029
Offset: 1

Views

Author

Patrick Quam, Dec 16 2021

Keywords

Comments

A173426(n) is the concatenation of all numbers from 1 up to k and then back down to 1. The prime terms of A173426 have been called "memorable primes" (see the Numberphile video). These "unmemorable primes" are a superset created by concatenating 1..k in ascending order followed by concatenating the numbers k-1..1 in descending order. Any primes found during either concatenation process are added to the sequence (e.g., k = 5, 1234543 is included. If 12345 were prime, it would be included as well).

Examples

			For k=10, the first prime obtained by concatenating the numbers 1..10 and then concatenating the first one or more numbers from 9..1 is 12345678910987.
		

Crossrefs

Programs

  • Maple
    select(isprime, [seq(seq(parse(cat($1..n, n-i$i=1..t)),
                    t=0..n-1), n=1..30)])[];  # Alois P. Heinz, Dec 19 2021
  • Mathematica
    lst={};Table[s=Flatten[IntegerDigits/@Range@n];k=n-1;
    While[k!=-1,If[PrimeQ[p=FromDigits@s],AppendTo[lst,p]];s=Join[s,IntegerDigits@k];k--],{n,100}];lst (* Giorgos Kalogeropoulos, Dec 17 2021 *)
  • Python
    from itertools import count, chain, islice, accumulate
    from sympy import isprime
    def A350153gen(): return filter(lambda p:isprime(p),(int(s) for n in count(1) for s in accumulate(str(d) for d in chain(range(1,n+1),range(n-1,0,-1)))))
    A350153_list = list(islice(A350153gen(),20)) # Chai Wah Wu, Dec 20 2021
Showing 1-1 of 1 results.