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!)
A049121 If a(n) is prime, a(n+1) = a(n) followed by a 1; if a(n) is composite, a(n+1) = concatenation of prime factors of a(n) (with multiplicity). 3
0, 1, 11, 111, 337, 3371, 33711, 317661, 3195573, 33134361, 313849599, 3714945219, 33412771691, 1341179350213, 7181173232711, 28979247806109, 3318731171903071, 191053757165759337, 3505114323880284323, 131572281752894106563, 1091640386973585393403 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
EXAMPLE
a(3)=111=3*37, so a(4)=3_37=337. 337 is prime, so a(5)=337_1=3371.
MAPLE
a:= proc(n) option remember; `if`(n=0, 0, (t-> parse(cat(`if`(isprime(t) or
t<2, [t, 1][], sort(map(i-> i[1]$i[2], ifactors(t)[2]))[]))))(a(n-1)))
end:
seq(a(n), n=0..21); # Alois P. Heinz, Apr 04 2022
MATHEMATICA
nxt[n_]:=If[n==0||n==1||PrimeQ[n], FromDigits[Join[IntegerDigits[n], {1}]], FromDigits[Flatten[IntegerDigits/@(Table[#[[1]], {#[[2]]}]&/@ FactorInteger[n])]]]; NestList[nxt, 0, 20] (* Harvey P. Dale, May 02 2012 *)
PROG
(Python)
from itertools import count, islice
from sympy import isprime, factorint
def agen():
yield from [0, 1]
an = 11
for n in count(3):
yield an
if isprime(an):
an = 10*an + 1
else:
an = int("".join(str(p) for p in factorint(an, multiple=True)))
print(list(islice(agen(), 21))) # Michael S. Branicky, Apr 04 2022
CROSSREFS
Sequence in context: A209233 A062095 A055657 * A143573 A248039 A244204
KEYWORD
nonn,easy,base,nice
AUTHOR
Mark Alexiuk (alexiuk(AT)ee.umanitoba.ca)
EXTENSIONS
More terms from Michel ten Voorde Corrected by Harvey P. Dale, Jun 06 2000.
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 18 18:59 EDT 2024. Contains 374388 sequences. (Running on oeis4.)