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: Todor Szimeonov

Todor Szimeonov's wiki page.

Todor Szimeonov has authored 22 sequences. Here are the ten most recent ones:

A364391 a(n) = n - (largest nontrivial divisor of n, or 0 if there is none).

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 4, 6, 5, 11, 6, 13, 7, 10, 8, 17, 9, 19, 10, 14, 11, 23, 12, 20, 13, 18, 14, 29, 15, 31, 16, 22, 17, 28, 18, 37, 19, 26, 20, 41, 21, 43, 22, 30, 23, 47, 24, 42, 25, 34, 26, 53, 27, 44, 28, 38, 29, 59, 30, 61, 31, 42, 32, 52, 33, 67, 34, 46, 35
Offset: 1

Author

Todor Szimeonov, Jul 21 2023

Keywords

Examples

			The largest nontrivial divisor of 6 is 3, so a(6) = 6 - 3 = 3.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n - If[CompositeQ[n], n/FactorInteger[n][[1, 1]], 0]; Array[a, 100] (* Amiram Eldar, Jul 22 2023 *)
  • Python
    from sympy import isprime, primefactors
    def A364391(n): return n if n==1 or isprime(n) else n-n//min(primefactors(n)) # Chai Wah Wu, Aug 20 2023

Formula

a(n) = n - A032742(n) if n is composite, n otherwise. - Jon E. Schoenfield, Jul 21 2023

A358156 a(n) is the smallest number k such that the sum of k consecutive prime numbers starting with the n-th prime is a square.

Original entry on oeis.org

9, 23, 4, 1862, 14, 3, 2, 211, 331, 163, 366, 3, 124, 48, 2, 449, 8403, 121, 35, 2, 4, 105, 77, 43, 190769, 1726, 234, 248, 200, 295, 293, 73, 4, 873, 32, 64, 2456139382, 8, 4519, 14, 123, 5, 9395, 296, 26, 5, 3479, 810, 9, 7091, 1669, 157, 1189, 12559, 269, 4930, 21, 376, 3
Offset: 1

Author

Todor Szimeonov, Nov 01 2022

Keywords

Comments

a(60) > 10^10 and a(68) > 10^13. - Martin Ehrenstein, Nov 09 2022

Examples

			For n=7, prime(7) = 17 and starting there 2 primes 17 + 19 = 36 which is square, so that a(7)=2.
		

Crossrefs

Cf. A000040, A000290, A105720, A230327 (exchanges the roles of n, k), A287027 (squares reached).
Indices of terms: A064397 (2's), A076305 (3's), A072849 (4's), A166255 (70's), A166261 (120's).

Programs

  • Maple
    f:= proc(n) local p,s,k;
      p:= ithprime(n); s:= p;
      for k from 2 do
        p:= nextprime(p);
        s:= s+p;
        if issqr(s) then return k fi
      od
    end proc:
    map(f, [$1..36]); # Robert Israel, Nov 08 2022
  • Mathematica
    a[n_] := Module[{p = s = Prime[n], k = 1}, While[! IntegerQ[Sqrt[s]], p = NextPrime[p]; s += p; k++]; k]; Array[a, 36] (* Amiram Eldar, Nov 08 2022 *)

Extensions

a(25)-a(36) from Robert Israel, Nov 08 2022
a(37)-a(59) from Martin Ehrenstein, Nov 09 2022

A346145 Primes of the form k^2 + 25.

Original entry on oeis.org

29, 41, 61, 89, 281, 349, 509, 601, 701, 809, 1049, 1181, 1321, 1789, 2141, 2729, 3389, 4649, 5209, 5501, 5801, 8861, 9241, 9629, 10429, 11261, 11689, 12569, 15401, 15901, 17449, 17981, 18521, 19069, 21341, 21929, 23741, 24989, 26921, 27581, 33149, 39229, 40829, 41641, 42461, 45821, 46681, 52009
Offset: 1

Author

Todor Szimeonov, Jul 06 2021

Keywords

Comments

k^2 + 25 = (k+5i)*(k-5i), where i is the imaginary unit.

Crossrefs

Programs

  • Mathematica
    Select[Range[230]^2 + 25, PrimeQ] (* Amiram Eldar, Jul 06 2021 *)
  • PARI
    list(lim)=my(v=List(),p); forstep(k=2,sqrtint(lim\1-25),2, if(isprime(p = k^2+25), listput(v,p))); Vec(v) \\ Charles R Greathouse IV, Jul 06 2021

Formula

a(n) >> n log^2 n (Brun sieve). - Charles R Greathouse IV, Jul 06 2021

A343070 a(1) = 1, for n > 1, a(n) is the smallest positive integer for which a(n-1) + n + a(n) is a prime.

Original entry on oeis.org

1, 2, 2, 1, 1, 4, 2, 1, 1, 2, 4, 1, 3, 2, 2, 1, 1, 4, 6, 3, 5, 2, 4, 1, 3, 2, 2, 1, 1, 6, 4, 1, 3, 4, 2, 3, 1, 2, 2, 1, 1, 4, 6, 3, 5, 2, 4, 1, 3, 6, 2, 5, 1, 4, 2, 1, 1, 2, 6, 1, 5, 4, 4, 3, 3, 2, 2, 1, 1, 2, 6, 1, 5, 4, 4, 3, 3, 2, 2, 1, 1, 6, 8
Offset: 1

Author

Todor Szimeonov, Apr 04 2021

Keywords

Crossrefs

Cf. A343039.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = NextPrime[a[n - 1] + n] - a[n - 1] - n; Array[a, 100] (* Amiram Eldar, Apr 04 2021 *)
  • Python
    from sympy import nextprime
    def aupton(terms):
      alst = [1]
      for n in range(2, terms+1):
        alst.append(nextprime(alst[-1] + n) - alst[-1] - n)
      return alst
    print(aupton(87)) # Michael S. Branicky, Apr 04 2021

A343039 a(1) = 1, for n > 1, a(n) is the smallest positive integer for which a(n-1) + n + a(n) is a square.

Original entry on oeis.org

1, 1, 5, 7, 4, 6, 3, 5, 2, 4, 1, 3, 9, 2, 8, 1, 7, 11, 6, 10, 5, 9, 4, 8, 3, 7, 2, 6, 1, 5, 13, 4, 12, 3, 11, 2, 10, 1, 9, 15, 8, 14, 7, 13, 6, 12, 5, 11, 4, 10, 3, 9, 2, 8, 1, 7, 17, 6, 16, 5, 15, 4, 14, 3, 13, 2, 12, 1, 11
Offset: 1

Author

Todor Szimeonov, Apr 03 2021

Keywords

Programs

  • Mathematica
    d[n_] := Floor[Sqrt[n] + 1]^2 - n; a[1] = 1; a[n_] := a[n] = d[a[n - 1] + n]; Array[a, 100] (* Amiram Eldar, Apr 03 2021 *)
  • Python
    from math import isqrt
    def aupton(terms):
      alst = [1]
      for n in range(2, terms+1):
        alst.append((isqrt(alst[-1] + n)+1)**2 - alst[-1] - n)
      return alst
    print(aupton(79)) # Michael S. Branicky, Apr 03 2021

A338386 The smallest number from the n-membered group of single (non-twin) primes.

Original entry on oeis.org

23, 47, 79, 79, 353, 353, 353, 353, 353, 353, 673, 673, 673, 673, 673, 673, 673, 673, 8641, 8641, 8641, 8641, 13411, 13411, 13411, 14633, 14633, 24439, 24439, 24439, 24439, 24439, 24439, 24439, 24439, 24439, 24439, 24439, 24439, 24439, 62303, 62303, 62303, 62303
Offset: 1

Author

Todor Szimeonov, Oct 23 2020

Keywords

Comments

Note that "single" means both non-twin and not 2.

Crossrefs

Programs

  • Mathematica
    c = cm = s1 = 0; p = 3; q = 5; s = {}; Do[If[c == 0, s1 = q]; r = NextPrime[q]; If[r > q + 2 && q > p + 2, c++, c = 0]; If[c > cm, cm = c; AppendTo[s, s1]]; p = q; q = r, {10^4}]; s (* Amiram Eldar, Oct 25 2020 *)

Extensions

More terms from Amiram Eldar, Oct 25 2020

A338049 a(n) is the smallest prime that is not less than prime(n) and is such that prime(n)*a(n)+2 is semiprime.

Original entry on oeis.org

2, 11, 11, 7, 11, 19, 17, 29, 29, 29, 37, 37, 43, 43, 61, 53, 61, 71, 89, 79, 73, 79, 83, 103, 97, 103, 107, 109, 113, 127, 131, 151, 137, 151, 157, 197, 167, 167, 173, 181, 211, 199, 191, 197, 199, 211, 227, 257, 257, 241, 233, 251, 257, 251, 263, 263, 269
Offset: 1

Author

N. J. A. Sloane, Oct 08 2020, based on an email from Todor Szimeonov, Oct 07 2020

Keywords

Comments

Motivated by a question about arranging square tiles in a rectangle.

Crossrefs

A338048 a(n) is the smallest number that is not less than n such that n*a(n)+2 is semiprime.

Original entry on oeis.org

2, 2, 4, 5, 11, 6, 7, 9, 13, 12, 11, 12, 19, 16, 19, 17, 17, 18, 20, 21, 23, 30, 24, 26, 32, 34, 27, 30, 29, 36, 37, 36, 35, 36, 35, 41, 37, 40, 43, 41, 43, 42, 43, 45, 47, 50, 48, 48, 51, 52, 51, 57, 53, 54, 55, 57, 59, 60, 61, 60, 63, 76, 64, 65, 65, 66, 75
Offset: 1

Author

N. J. A. Sloane, Oct 08 2020, based on an email from Todor Szimeonov, Oct 07 2020

Keywords

Comments

Motivated by a question about arranging square tiles in a rectangle.

Crossrefs

A336238 a(1) = 3; if n>1, and gcd(a(n-1), n) > 1 then a(n) = a(n-1)/gcd(a(n-1), n), otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

3, 5, 8, 2, 7, 13, 20, 5, 14, 7, 18, 3, 16, 8, 23, 39, 56, 28, 47, 67, 88, 4, 27, 9, 34, 17, 44, 11, 40, 4, 35, 67, 100, 50, 10, 5, 42, 21, 7, 47, 88, 44, 87, 131, 176, 88, 135, 45, 94, 47, 98, 49, 102, 17, 72, 9, 3, 61, 120, 2, 63, 125, 188, 47, 112, 56, 123, 191
Offset: 1

Author

Todor Szimeonov, Jul 13 2020

Keywords

Crossrefs

Cf. A093178.

Programs

  • PARI
    a(n) = if (n==1, 3, my(prec=a(n-1)); if (gcd(prec, n) > 1, prec/gcd(prec,n), n+prec)); \\ Michel Marcus, Jul 13 2020

A336164 a(1) = 1; if n>1, and gcd(a(n-1), n) > 1 then a(n) = a(n-1)/gcd(a(n-1), n), otherwise a(n) = a(n-1) + n - 1.

Original entry on oeis.org

1, 2, 4, 1, 5, 10, 16, 2, 10, 1, 11, 22, 34, 17, 31, 46, 62, 31, 49, 68, 88, 4, 26, 13, 37, 62, 88, 22, 50, 5, 35, 66, 2, 1, 35, 70, 106, 53, 91, 130, 170, 85, 127, 170, 34, 17, 63, 21, 3, 52, 102, 51, 103, 156, 210, 15, 5, 62, 120, 2, 62, 1, 63, 126, 190, 95, 161, 228, 76
Offset: 1

Author

Todor Szimeonov, Jul 10 2020

Keywords

Crossrefs

Cf. A133058.

Programs

  • PARI
    a(n) = if (n==1, 1, my(prec=a(n-1)); if (gcd(prec, n) > 1, prec/gcd(prec,n), n-1+prec)); \\ Michel Marcus, Jul 13 2020
    
  • Python
    from itertools import count, islice
    from math import gcd
    def A336164_gen(): # generator of terms
        yield (a:=1)
        for n in count(2):
            yield (a:=a+n-1 if (b:=gcd(a,n)) == 1 else a//b)
    A336164_list = list(islice(A336164_gen(),30)) # Chai Wah Wu, Mar 18 2023