login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A113574 a(n) is the least n-digit number whose k-th digit is prime if k is prime, composite if k is composite, and 1 if k=1. 1
1, 12, 122, 1224, 12242, 122424, 1224242, 12242424, 122424244, 1224242444, 12242424442, 122424244424, 1224242444242, 12242424442424, 122424244424244, 1224242444242444, 12242424442424442, 122424244424244424 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Alvin Hoover Belt, Table of n, a(n) for n = 1..75

FORMULA

a(n+1) = a(n)||2 if n+1 is prime, otherwise a(n+1) = a(n)||4 where || is concatenation.

PROG

(Python)

from sympy import isprime

def a(n): return 1 if n<2 else int(str(a(n - 1)) + "2") if isprime(n) else int(str(a(n - 1)) + "4")

print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Apr 12 2017

CROSSREFS

Sequence in context: A134584 A090843 A132927 * A255307 A199592 A285807

Adjacent sequences:  A113571 A113572 A113573 * A113575 A113576 A113577

KEYWORD

base,easy,nonn,changed

AUTHOR

Amarnath Murthy, Nov 06 2005

EXTENSIONS

Corrected and extended by Alvin Hoover Belt, Mar 24 2008

Name edited by Jon E. Schoenfield, Mar 20 2021

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 10 01:36 EDT 2021. Contains 343747 sequences. (Running on oeis4.)