OFFSET
1,1
COMMENTS
This could be roughly rephrased like this: "Rewrite in the most economical way the prime number 'pattern' using only composite numbers." - Michael De Vlieger, Nov 30 2015, after Danny Rorabaugh at A097487.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
From Michael De Vlieger, Nov 30 2015: (Start)
We begin with N = 235711131719..., taking first digits until we have a composite concatenation. Since 2 and 23 are prime, 235 is the first term. We continue with 711131719... and since 7 and 71 are prime, 711 is the next term.
Composite terms are formed such that the following term has no leading zeros, so as to preserve all the digits of N.
The terms {710, 110, 310, 710} derive from the primes {97, 101, 103, 107, 109} and happen to be formed because eliding the zero would result in a prime in these cases.
a(70) = 330 because although 33 would suffice as it is composite, the zero leading next digits 07311313... would result in a(71) losing a digit of N. (End)
MATHEMATICA
lim = 123; f[lst_List, k_] := Block[{L = lst, g, a = {}, m = 0}, g[] := {Set[m, First@ FromDigits@ Append[IntegerDigits@ m, First@ #]], Set[L, Last@ #]} &@ TakeDrop[L, 1]; Do[g[]; While[Or[! CompositeQ@ m, First@ L == 0], g[]]; AppendTo[a, m]; m = 0, {k}]; a]; f[Flatten@ Map[IntegerDigits, Prime@ Range@ lim], Floor[lim/2]] (* Michael De Vlieger, Nov 30 2015, Version 10.2 *)
CROSSREFS
KEYWORD
AUTHOR
Amarnath Murthy, Mar 01 2002
EXTENSIONS
Corrected and extended by Eli McGowan (ejmcgowa(AT)mail.lakeheadu.ca), May 06 2002
STATUS
approved