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.

User: Giovanni Resta

Giovanni Resta's wiki page.

Giovanni Resta has authored 1112 sequences. Here are the ten most recent ones:

A386965 Number of permutations p of [2*n] such that there is at least one index i in [2*n-1] with p(i+1) = n + p(i).

Original entry on oeis.org

1, 10, 294, 16296, 1458120, 191751120, 34807535280, 8337722440320, 2547572372311680, 966944845408147200, 446304490431888211200, 246166572372916851532800, 159902551429370021259187200, 120818209587660157360960972800, 105060730670227917425027835648000
Offset: 1

Author

Giovanni Resta, Aug 11 2025

Keywords

Comments

Problem 6 at IMO '89 essentially asks to show that a(n) > (2*n)!/4.

Examples

			The 10 permutations corresponding to a(2) are 1243, 1324, 1342, 2134, 2413, 2431, 3124, 3241, 4132, 4213.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(k+1) Binomial[n, k] (2 n - k)!, {k, n}]; Array[a, 15]

Formula

a(n) = Sum_{k=1..n} (-1)^(k+1) * binomial(n,k) * (2*n - k)!.
a(n) = (2*n)! * (1 - 1F1(-n; -2*n; -1)).
a(n) = n! * A324361(n).

A367600 Numbers that are not the comma-successor of any number.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28, 29, 30, 31, 32, 37, 38, 39, 40, 41, 42, 43, 49, 50, 51, 52, 53, 54, 60, 62, 63, 64, 65, 70, 74, 75, 76, 80, 86, 87, 90, 98, 200, 300, 400, 500, 600, 700, 800, 900, 2000, 3000, 4000, 5000, 6000, 7000
Offset: 1

Author

Giovanni Resta, Nov 23 2023

Keywords

Comments

These are the positive integers that do not appear in A367338.
All terms > 98 are of the form c*10^i for i >= 2 and 2 <= c <= 9; see proof in links. - Michael S. Branicky, Nov 28 2023

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A367338(n):
        nn = n + 10*(n%10)
        return next((nn+y for y in range(1, 10) if str(nn+y)[0] == str(y)), -1)
    def agen():
        A367338_set = set()
        for n in count(1):
            A367338_set.add(A367338(n))
            if n not in A367338_set:
                yield n
            # A367338_set.discard(n-100) # uncomment if memory is an issue
    print(list(islice(agen(), 86))) # Michael S. Branicky, Nov 28 2023

A361336 Smallest decimal number containing n palindromic substrings (Version 2). See Comments for precise definition.

Original entry on oeis.org

0, 10, 11, 100, 1002, 111, 1000, 10002, 10001, 1111, 10000, 100002, 100001, 1000012, 11111, 100000, 1000002, 1000001, 10000012, 10000010, 111111, 1000000, 10000002, 10000001, 100000012, 100000010, 110111111, 1111111, 10000000, 100000002, 100000001, 1000000012, 1000000010
Offset: 1

Author

N. J. A. Sloane, Apr 01 2023, based on postings to the Sequence Fans Mailing list by Eric Angelini, Mar 28 2023 (definition), and Giovanni Resta, Mar 28 2023 (terms)

Keywords

Comments

Suppose m has decimal expansion d_1 d_2 ... d_k. A palindromic substring here is any substring d_i, d_{i+1}, ..., d_j with 1 <= i <= j <= n which is palindromic. In this version d_i can be 0 even if j>i. For example, if m = 10^3 + 1 = 1001 there are six substrings: 1, 0, 0, 1, 00, and 1001. See A361335 for Version 1.

Crossrefs

Cf. A361335.

A361335 Smallest decimal number containing n palindromic substrings (Version 1). See Comments for precise definition.

Original entry on oeis.org

0, 10, 11, 101, 1001, 111, 1110, 10101, 10111, 1111, 11110, 102222, 101111, 1001111, 11111, 111110, 1022222, 1011111, 10011111, 11101111, 111111, 1111110, 10222222, 10111111, 100111111, 111111212, 110111111, 1111111, 11111110, 102222222, 101111111, 1001111111, 1111111212, 1101111111, 10101111111, 11111111, 111111110
Offset: 1

Author

N. J. A. Sloane, Apr 01 2023, based on postings to the Sequence Fans Mailing list by Eric Angelini, Mar 28 2023 (definition), and Giovanni Resta, Mar 28 2023 (terms)

Keywords

Comments

Suppose m has decimal expansion d_1 d_2 ... d_k. A palindromic substring here is any substring d_i, d_{i+1}, ..., d_j with 1 <= i <= j <= n which is palindromic, except that if d_i = 0 then i = j. For example, if m = 10^3 + 1 = 1001 there are five substrings: 1, 0, 0, 1, 1001 (but not 00). See A361336 for Version 2.

Crossrefs

Cf. A361336.

A335817 a(k) is the index of the first occurrence of 2*k-1 in A208884, or 0 if it does not occur.

Original entry on oeis.org

1, 2, 13, 4, 6, 75, 22975, 11, 15, 10, 1417, 37, 17, 12, 573, 19, 16, 49, 28, 227, 34, 18, 26, 31, 1371, 20, 41, 36, 8181, 339, 38, 30, 40, 207, 43, 70, 1113, 91, 235, 32, 63, 203, 50, 60, 103, 48, 189, 42, 421, 57, 74, 98, 65, 259, 11997, 155, 44, 54, 199, 67
Offset: 1

Author

Giovanni Resta, Jun 25 2020

Keywords

Comments

It is conjectured that A208884 contains all the odd numbers. If so, a(n) > 0 for every n.

Examples

			The first terms of A208884 are 1, 3, 3, 7, 3, so a(2*1-1) = 1, a(2*2-1) = 2, and a(2*4-1) = 4.
		

Crossrefs

Cf. A208884.

Programs

  • Mathematica
    b[1]=1; b[n_] := b[n] = #/2^IntegerExponent[#, 2] &@ (n + b[n-1]); A = Transpose@ {b /@ #, #} &@ Range[25000]; A = DeleteDuplicatesBy[ Sort@ A, First]; Last /@ TakeWhile[ A, A[[ (First[#] + 1)/2, 1]] == First@# &]

A335498 a(n) is the least odd number k such that Omega(k) = n and Omega(k+2) = n+1, where Omega(k) is the number of prime factors of k (A001222).

Original entry on oeis.org

1, 7, 25, 873, 1375, 41875, 903123, 1015623, 49671873, 200921875, 1157734375, 41898828123, 496308203125, 10506958984375, 7739037109375, 382999267578123, 17016876976778523, 46804302197265625, 80713609326109375
Offset: 0

Author

Giovanni Resta, Jun 11 2020

Keywords

Examples

			a(3) = 873 because Omega(873) = Omega(3^2*97) = 3, Omega(873+2) = Omega(5^3*7) = 4 and 873 is the smallest such integer.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{ov=0, v=1, k=3}, While[ov != n || v != n+1, ov = v; k += 2; v = PrimeOmega@ k]; k-2]; a /@ Range[0, 6]
  • PARI
    generate(A, B, n, k) = A=max(A, 2^n); (f(m, p, n) = my(list=List()); if(n==1, forprime(q=max(p,ceil(A/m)), B\m, my(t=m*q); if(bigomega(t-2) == k, listput(list, t-2))), forprime(q=p, sqrtnint(B\m, n), list=concat(list, f(m*q, q, n-1)))); list); vecsort(Vec(f(1, 3, n)));
    a(n) = my(x=2^n, y=2*x); while(1, my(v=generate(x, y, n+1, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Jul 08 2023

Extensions

a(12)-a(18) from Daniel Suteu, Jul 08 2023

A335496 a(n) is the least odd number k such that Omega(k) = n, Omega(k+2) = n+1, and Omega(k+4) = n+2, where Omega(k) is the number of prime factors of k (A001222).

Original entry on oeis.org

23, 871, 5423, 229955, 13771373, 558588875, 21549990623, 1325878234371, 17040894859373, 429205867309373
Offset: 1

Author

Zak Seidov and Giovanni Resta, Jun 11 2020

Keywords

Comments

a(n) mod 81 for n = 1..8: {23, 61, 77, 77, 77, 77, 77, 0}.

Examples

			23 is a term: 23 is a prime, 25=5*5 is a semiprime, 27=3*3*3 is a triprime.
871 is a term: 871 = 13*67 (semiprime), 873 = 3*3*97 (triprime), 875 = 5*5*5*7 (quadprime).
		

Crossrefs

Cf. A335498.

Programs

  • PARI
    generate(A, B, n, k) = A=max(A, 2^n); (f(m, p, n) = my(list=List()); if(n==1, forprime(q=max(p, ceil(A/m)), B\m, my(t=m*q); if(bigomega(t-4) == k && bigomega(t-2) == k+1, listput(list, t-4))), forprime(q=p, sqrtnint(B\m, n), list=concat(list, f(m*q, q, n-1)))); list); vecsort(Vec(f(1, 3, n)));
    a(n) = my(x=2^n, y=2*x); while(1, my(v=generate(x, y, n+2, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Jul 08 2023

Formula

a(n) >= A335498(n). - Daniel Suteu, Jul 08 2023

Extensions

a(9)-a(10) from Daniel Suteu, Jul 08 2023

A335205 Numbers of m digits which are equal to the absolute value of the sum of the m-th powers of their digits, with alternating signs.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 48, 407, 5920, 5921, 2918379, 18125436, 210897052, 11647261846, 18107015789, 27434621679, 31332052290, 4986706842391, 485927682264092, 1287253463537089, 1217506990394433558, 11008589751726485523, 107765279704274410345, 109462377410000145640, 109462377410000145641, 118620909850977982494, 319591187568367788829
Offset: 1

Author

Giovanni Resta, May 26 2020

Keywords

Comments

Numbers n equal to |Sum_{j=1..k} (-1)^j*d_j^k| where d_1 d_2 ... d_k is the decimal expansion of n. A variant of narcissistic numbers (A005188), they are finite as well.
The last term is smaller than 1.2*10^50. - Jinyuan Wang, May 28 2020
Note that a(14) = a(13) + 1, a(29) = a(28) + 1 - Chai Wah Wu, Jun 03 2020

Examples

			5921 is a term because |5^4 - 9^4 + 2^4 - 1^4| = 5921.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := Block[{d = IntegerDigits@ n}, Abs@ Total[d^Length[d] (-1)^Range@ Length@ d]]; Select[ Range[0, 3*10^6], s[#] == # &]
  • PARI
    is(k)= my(v=digits(k)); abs(sum(i=1, #v, (-1)^i*v[i]^#v))==k; \\ Jinyuan Wang, May 28 2020

Extensions

a(24)-a(25) from Chai Wah Wu, May 31 2020
a(26) from Chai Wah Wu, Jun 01 2020
a(27)-a(31) from Chai Wah Wu, Jun 03 2020

A334885 Let q = p | p' be the digit concatenation of a prime p with its prime successor. If the result is a prime repeat the construction setting p = q. a(n) is the smallest prime for which this can be repeated exactly n times.

Original entry on oeis.org

3, 2, 13681, 467, 127787377, 200603842261
Offset: 0

Author

Giovanni Resta, May 14 2020

Keywords

Comments

a(6) > 10^13.

Examples

			Let "|" denote concatenation.
3 | 5 = 35, which is not prime, so a(0) = 3.
2 | 3 = 23 (prime), 23 | 29 = 2329 (composite), so a(1) = 2.
13681 | 13687 (prime), 1368113687 | 1368113699 (prime), 13681136871368113699 | 13681136871368113711 (composite), so a(2) = 13681.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{pp=1, p, q, c=-1}, While[ c!=n, c=0; p = pp = NextPrime@ pp; While[ PrimeQ[ q = FromDigits[ Join @@ IntegerDigits@{p, NextPrime@ p}]], c++; p = q]]; pp]; a /@ Range[0, 3]

A334726 a(k) is the earliest start of sequence of exactly k primes generated according to the rules stipulated in A005150.

Original entry on oeis.org

1, 2, 3, 7, 373, 1223, 233, 19972667609, 75022592087629
Offset: 0

Author

Giovanni Resta, May 09 2020

Keywords

Examples

			The sequence starting at 7 is 7 (prime), 17 (prime), 1117 (prime), and 3117 (composite), so a(3) = 7.
		

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime
    from itertools import count, groupby, islice
    def LS(n):
        return int(''.join(str(len(list(g)))+k for k, g in groupby(str(n))))
    def f(n): return 0 if not isprime(n) else 1 + f(LS(n))
    def agen(startn=0, startk=1):
        n, adict = startn, {i:-1 for i in range(startn)}
        for k in count(startk):
            fk = f(k)
            if fk not in adict: adict[fk] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 7))) # Michael S. Branicky, Jul 27 2022