login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A258227 Concatenate the natural numbers, then partition into minimal strings so that adjacent terms have a common divisor greater than 1. 2
12, 3, 45, 6, 78, 9, 1011, 12, 1314, 15, 1617, 18, 192, 0, 2, 12, 2, 2, 32, 4, 2, 52, 6, 2, 72, 8, 2, 930, 3, 132, 3, 3, 3, 435, 3, 6, 3, 738, 3, 9, 4041, 42, 4, 34, 4, 4, 54, 6, 4, 74, 8, 4, 950, 5, 15, 25, 35, 45, 5, 5, 65, 75, 85, 960, 6, 16, 2, 6, 3, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
00 -> 0 is not allowed, else all digits will not appear in the concatenation of terms. For example, a(198)..a(201) = 198, 19920, 0, 2 and not 198, 192, 0, 2. - Michael S. Branicky, Dec 03 2021
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (24 terms corrected in terms 1..10000 from Reinhard Zumkeller)
FORMULA
GCD(a(n), a(n+1)) > 1.
EXAMPLE
. a(n) | 12,3,45,6,78,9,1011,12,1314,15,1617,18,192,0,2,12,2,2,32,4,2,52
--------+----------------------------------------------------------------
. gcd | 3 3 3 6 3 3 3 6 3 3 3 6 192 2 2 2 2 2 4 2 2 .
PROG
(Haskell)
a258227 n = a258227_list !! (n-1)
a258227_list = f 12 1 (map toInteger $ tail a007376_list) where
f x y (d:ds) | gcd x y > 1 = y : f y d ds
| otherwise = f x (10 * y + d) ds
(Python)
from math import gcd
from itertools import count
def diggen():
for k in count(1): yield from list(map(int, str(k)))
def aupton(terms):
g = diggen()
alst, aset = [12], {12}
_, _, nxtd, nxtnxtd = next(g), next(g), next(g), next(g)
for n in range(2, terms+1):
an, nxtd, nxtnxtd = nxtd, nxtnxtd, next(g)
while gcd(an, alst[-1]) == 1 or nxtd == nxtnxtd == 0:
an, nxtd, nxtnxtd = int(str(an) + str(nxtd)), nxtnxtd, next(g)
alst.append(an); aset.add(an)
return alst
print(aupton(70)) # Michael S. Branicky, Dec 03 2021
CROSSREFS
Sequence in context: A317312 A112033 A248171 * A130895 A367431 A038329
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, May 23 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 27 20:25 EDT 2024. Contains 374651 sequences. (Running on oeis4.)