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

A329147 Replace in n each nonzero digit d with prime(d).

Original entry on oeis.org

0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 20, 22, 23, 25, 27, 211, 213, 217, 219, 223, 30, 32, 33, 35, 37, 311, 313, 317, 319, 323, 50, 52, 53, 55, 57, 511, 513, 517, 519, 523, 70, 72, 73, 75, 77, 711, 713, 717, 719, 723, 110, 112, 113, 115, 117, 1111, 1113, 1117, 1119, 1123
Offset: 0

Views

Author

Bernard Schott, Nov 06 2019

Keywords

Comments

Some properties:
No term has a digit 4, 6 or 8.
No term begins with 9, 10, 12, 15, 29, 39, 59, 79.
If a is regarded as a function a: n --> a(n) from N to N, then
1) a is neither increasing: a(9) > a(10) nor decreasing: a(3) < a(4),
2) a is not injective: a(92) = a(122) = 233,
3) a is not surjective: 4 and 15 are not terms. The integers that are not in this sequence are in A329149 and the integers that are obtained are in A329150, with increasing order.
Some primes remain primes: 2, 3, 5, 7, 19, 59, ...
Some primes become composites: 11, 13, 17, 23, 29, 31, ...
Some composites remain composites: 10, 14, 16, 18, 20, 21, 22,...
Some composites become primes: 4, 6, 8, 9, 12, 15, 24, 25, 26,...
When n > 4 ends respectively with 0, 1 or 3 then a(n) that ends with 0, 2, 5 is composite.
The sequence 9, 99, 999, ..., respectively 12, 1212, 121212, ... generates the same numbers 23, 2323, 232323, ... Analogously, 9, 92, 922, 922, ... and 12, 122, 1222, ... generate the same sequence 23, 233, 2333, 23333, .... For the numbers 91,9191,919191, ... the terms of the sequence are 232, 232232, 232232232, ... so palindromes. - Marius A. Burtea, Nov 07 2019
The numbers 113, 14113, 1441113, 144411113, ... determine the terms 225 = 15^2, 27225 = 165^2, 2772225 = 1665^2, ... (in A191486). The numbers 14, 14000, 14000000, ... determine the terms 27 = 3^3, 27000 = 30^3, 27000000 = 300^3, .... - Marius A. Burtea, Nov 12 2019

Examples

			As a(2) = prime(2) = 3, a(5) = prime(5) = 11 and a(8) = prime(8) = 19, a(258)= 31119.
As a(3) = prime(3) = 5, a(0) = 0 and a(7) = prime(7) = 17, hence a(307) = 5017.
		

Crossrefs

Similar to A048380, A048385 and A322131.

Programs

  • Magma
    v:=[0,2,3,5,7,11,13,17,19,23]; [0] cat [StringToInteger(&cat[IntegerToString(k): k in Reverse([v[m+1]: m in Intseq(n)])]): n in [1..60]]; // Marius A. Burtea, Nov 07 2019
    
  • Maple
    a:= n-> (l-> parse(cat(seq(`if`(l[-i]=0, 0, ithprime(l[-i])),
                 i=1..nops(l)))))(convert(n, base, 10)):
    seq(a(n), n=0..80);  # Alois P. Heinz, Nov 07 2019
  • Mathematica
    p[n_] := If[n > 0, Prime[n], 0]; a[n_] := FromDigits[Flatten @ IntegerDigits @ (p /@ IntegerDigits[n])]; Array[a, 60, 0] (* Amiram Eldar, Nov 06 2019 *)
  • PARI
    a(n) = if (n, fromdigits(concat(apply(d -> if (d, digits(prime(d)), [0]), digits(n)))), 0) \\ Rémy Sigrist, Nov 07 2019
    
  • Python
    def A329147(n): return int("".join(map(str, ([0, 2, 3, 5, 7, 11, 13, 17, 19, 23][int(i)] for i in str(n)))))
    print([A329147(n) for n in range(60)]) # Michael S. Branicky, Apr 10 2023

A329150 Increasingly ordered list without repetition of numbers k that are obtained, when, for nonnegative integers n, each nonzero digit d is replaced with prime(d).

Original entry on oeis.org

0, 2, 3, 5, 7, 11, 13, 17, 19, 20, 22, 23, 25, 27, 30, 32, 33, 35, 37, 50, 52, 53, 55, 57, 70, 72, 73, 75, 77, 110, 112, 113, 115, 117, 130, 132, 133, 135, 137, 170, 172, 173, 175, 177, 190, 192, 193, 195, 197, 200, 202, 203, 205, 207, 211, 213, 217, 219, 220
Offset: 1

Views

Author

Bernard Schott, Jan 11 2020

Keywords

Comments

As A329147 is not increasing, not decreasing, not surjective, not injective, another possible name could be: Terms of A329147 in increasing order without repetition.
No term can have digits 4, 6 or 8; also, no term begins with 9, 10, 12, 15, 29, 39, 59 or 79.
First primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 37, 53, ...
First squares are 0, 25, 225, 2025, 2500, 3025, 7225, ...
First palindromes are 0, 2, 3, 5, 7, 11, 22, 33, 55, 77, 202, 222, 232, ...

Examples

			Prime(1) = 2, prime(5) = 11, so A329147(15) = 211 and 211 is a term.
		

Crossrefs

Cf. A329147, A329149 (complement).

Programs

  • PARI
    f(n) = if (n, fromdigits(concat(apply(d -> if (d, digits(prime(d)), [0]), digits(n)))), 0); \\ A329147
    lista(nn) = my(list = List(), m); for (n=0, nn, m = f(n); if (m <= nn, listput(list, m));); Set(list); \\ Michel Marcus, Mar 26 2023

A361750 Terms of A329150 that have several preimages.

Original entry on oeis.org

23, 223, 230, 232, 233, 235, 237, 323, 523, 723, 1123, 1323, 1723, 1923, 2023, 2223, 2230, 2232, 2233, 2235, 2237, 2300, 2302, 2303, 2305, 2307, 2311, 2313, 2317, 2319, 2320, 2322, 2323, 2325, 2327, 2330, 2332, 2333, 2335, 2337, 2350, 2352, 2353, 2355, 2357, 2370, 2372, 2373, 2375, 2377
Offset: 1

Views

Author

Bernard Schott, Mar 23 2023

Keywords

Comments

From k = 1 to 9, A329147(k) has more than one preimage only for k = 9 since A329147(9) = A329147(12) = 23; so, all terms of this sequence have in their decimal expansion the two-digit integer '23'; it follows that when || denotes concatenation, the terms of this sequence are of the form:
X||23 as 223, 323, 523, 723, 1123, 1323, 1723, 1923, 2023, 2223, ... or,
23||Y as 230, 232, 233, 235, 237, 2300, 2302, 2303, 2305, 2307, 2311, ... or,
X||23||Y as 2230, 2232, 2233, 2235, 2237, 3230, 3232, 3233, ...
Every term of this sequence has 2^q preimages, and the smallest terms with exactly 2^q preimages for q >= 1 are 23, 2323, 232323, ... with q times the 2-digit number 23 in its decimal expansion; hence, the 8 preimages of 232323 are 999, 9912, 9129, 91212, 1299, 12912, 12129 and 121212.

Examples

			One example for each type:
23||2 = 232 = A329147(91) = A329147(121).
7||23 = 723 = A329147(49) = A329147(412).
2||23||5 = 2235 = A329147(193) = A329147(1123).
23||23 = 2323 = A329147(99) = A329147(129) = A329147(1212) = A329147(912).
		

Crossrefs

Programs

  • Mathematica
    p[n_] := If[n > 0, Prime[n], 0]; seq[ndigmax_] := Module[{t = Table[FromDigits[ Flatten @ IntegerDigits @ (p /@ IntegerDigits[n]) ], {n, 1, 10^ndigmax - 1}]}, Sort @ Select[Tally[t], First[#] < 10^ndigmax && Last[#] > 1 &][[;; , 1]]]; seq[4] (* Amiram Eldar, Mar 23 2023 *)
  • PARI
    f(n) = if (n, fromdigits(concat(apply(d -> if (d, digits(prime(d)), [0]), digits(n)))), 0); \\ A329147
    lista(nn) = {my(map = Map()); for (n=1, nn, my(m = f(n)); if (mapisdefined(map, m), mapput(map, m, 1+mapget(map, m)), mapput(map, m, 0));); my(list = List()); for (n=1, nn, if (mapisdefined(map, n), my(v = mapget(map, n)); if (#v > 0, listput(list, n)););); Vec(list);} \\ Michel Marcus, Mar 24 2023
Showing 1-3 of 3 results.