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: Mikk Heidemaa

Mikk Heidemaa's wiki page.

Mikk Heidemaa has authored 58 sequences. Here are the ten most recent ones:

A371631 Primes whose product of nonzero digits divided by the sum of its digits is also prime.

Original entry on oeis.org

167, 257, 523, 541, 617, 761, 1447, 1607, 1861, 2053, 2251, 2503, 2521, 2851, 4051, 5023, 5281, 5821, 6701, 8161, 8521, 10067, 10607, 10861, 11273, 11471, 12713, 13127, 13217, 13721, 14407, 16007, 17123, 17231, 17321, 18061, 20507, 20521, 21247, 21317, 21713, 22051
Offset: 1

Author

Mikk Heidemaa, May 24 2024

Keywords

Comments

No term N can have a "9" digit. [Proof: The sum of the digits of N is not a multiple of 3, but the numerator would be a multiple of 9, and so the number would be a multiple of 9, so not a prime.]

Examples

			167 (prime) is a term because 1*6*7/(1+6+7)=42/14=3 (prime).
		

Crossrefs

Subsequence of A038367.
Equals prime terms of A138566.

Programs

  • Mathematica
    pQ[n_] := Block[{idp = DeleteCases[IntegerDigits[n], 0]}, PrimeQ[Times @@ idp/Total@ idp]]; Cases[Prime@ Range@ PrimePi[10^5], _?pQ]
    Select[Prime[Range[2500]],PrimeQ[Times@@(IntegerDigits[#]/.(0->1))/Total[ IntegerDigits[ #]]]&] (* Harvey P. Dale, Sep 24 2024 *)

A359630 Primes p such that 10^p+3 or 10^p+9 is also prime.

Original entry on oeis.org

2, 3, 5, 11, 17, 101, 107, 26927, 48109
Offset: 1

Author

Mikk Heidemaa, Jan 08 2023

Keywords

Comments

Union of the terms which are prime in A049054 and in A088275.
If it exists, a(10) > 2*10^5 (according to the comment at A088275).

Examples

			3 is a term since it is prime and so is 10^3 + 9 = 1009.
11 is a term since it is prime and 10^11 + 3 = 100000000003 is also a prime.
		

Crossrefs

Programs

  • Mathematica
    Block[{p}, ParallelDo[p := Prime @ i; If[(PrimeQ[10^p + 3] || PrimeQ[10^p + 9]), Print @ p], {i, PrimePi @ 48109}, Method -> "FinestGrained"]]
    Select[Prime[Range[5000]],AnyTrue[10^#+{3,9},PrimeQ]&] (* Harvey P. Dale, Feb 09 2025 *)

A357915 Concatenation of the decimal digits of {n, 1..n}.

Original entry on oeis.org

11, 212, 3123, 41234, 512345, 6123456, 71234567, 812345678, 9123456789, 1012345678910, 111234567891011, 12123456789101112, 1312345678910111213, 141234567891011121314, 15123456789101112131415, 1612345678910111213141516
Offset: 1

Author

Mikk Heidemaa, Jan 18 2023

Keywords

Comments

Concatenation of the consecutive integers 1..n, with n prepended (n > 0).
The terms a(1), a(7), a(31), and a(337) are primes (of the form n1...n).
a(3643) is a 13469-digit probable prime (the number of digits is also a prime).
These indices 7, 31, 337, 3643 are themselves primes of the form 6m+1.
For the known terms a(n) which are primes and for a(3643), a(n) == 2 (mod 3).
There is no other prime term for n < 15000 (and no prime term with prime index n < 25000).

Examples

			a(2) = 212 since it is the concatenation of the consecutive positive integers <= 2, with 2 prepended.
		

Crossrefs

Programs

  • Mathematica
    aUpTo[n_] := Table[ FromDigits @ Flatten @ IntegerDigits @ {i, Range @ i}, {i,n}]; aUpTo[999]
  • PARI
    a(n) = my(s=Str(n)); for(k=1, n, s=Str(s, k)); eval(s); \\ Michel Marcus, Jan 20 2023
    
  • Python
    def a(n): return int(str(n)+"".join(map(str, range(1, n+1))))
    print([a(n) for n in range(1, 17)]) # Michael S. Branicky, Jan 20 2023

Formula

a(n) = concat(n, A007908(n)).

A359406 Integers k such that the concatenation of k consecutive primes starting at 31 is prime.

Original entry on oeis.org

1, 2, 3, 23, 43, 141
Offset: 1

Author

Mikk Heidemaa, Dec 30 2022

Keywords

Comments

The corresponding primes (p) known (31, 3137, 313741, ...) have an even number of digits and p (mod 10) == 1|7. For those at a(1)...a(6), p (mod 3) == p (mod 5) holds.
a(7): 3472 corresponds to a 15968-digit probable prime (certification in progress).
For a(8), k > 15000 (if it exists).
a(8) > 30000. - Tyler Busby, Feb 13 2023

Examples

			2 is a term because the consecutive primes 31 and 37 concatenated to 3137 yield another prime.
		

Crossrefs

Programs

  • Mathematica
    UpToK[k_] := Block[{a := FromDigits @ Flatten @ IntegerDigits @ Join[{}, Prime @ Range[11, i]]}, Reap[ Do[ If[ PrimeQ[a], Sow[i - 10], Sow[Nothing]], {i, k}]]][[2, 1]]; UpToK[3500] (* or *)
    UpToK[k_] := Flatten @ Parallelize @ MapIndexed[ If[ PrimeQ[#1], #2, Nothing] &, DeleteCases[ FromDigits /@ Flatten /@ IntegerDigits @ Prime @ Range[11, Range[k]], 0]]; UpToK[3500]

A343834 Primes with digits in nondecreasing order, only primes, and with sum of digits also a prime.

Original entry on oeis.org

2, 3, 5, 7, 23, 223, 227, 337, 557, 577, 2333, 2357, 2377, 2557, 2777, 33377, 222337, 222557, 233357, 233777, 235577, 2222333, 2233337, 2235557, 3337777, 3355777, 5555777, 22222223, 22233577, 23333357, 23377777, 25577777, 222222227, 222222557, 222222577
Offset: 1

Author

Mikk Heidemaa, May 01 2021

Keywords

Comments

Intersection of A028864 and A062088.

Crossrefs

Programs

  • Mathematica
    a[p_] := With[{dg = IntegerDigits@p}, PrimeQ@p && OrderedQ@dg && AllTrue[dg, PrimeQ] && PrimeQ@ Total@dg]; Cases[ Range[3*10^7], _?(a@# &)] (* or *)
    upToDigitLen[k_] := Cases[ FromDigits@# & /@ Select[ Flatten[ Table[ Tuples[{2, 3, 5, 7}, {i}], {i, k}], 1], OrderedQ[#] &], _?(PrimeQ@# && PrimeQ@ Total@ IntegerDigits@# &)]; upToDigitLen[10]
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_combinations
    def aupton(terms):
      n, digits, alst = 0, 1, []
      while len(alst) < terms:
        mcstr = "".join(d*digits for d in "2357")
        for mc in multiset_combinations(mcstr, digits):
          sd = sum(int(d) for d in mc)
          if not isprime(sd): continue
          t = int("".join(mc))
          if isprime(t): alst.append(t)
          if len(alst) == terms: break
        else: digits += 1
      return alst
    print(aupton(35)) # Michael S. Branicky, May 01 2021

Extensions

a(33) and beyond from Michael S. Branicky, May 01 2021

A343768 Primes p such that p^2 + 1 divides 3^(p+1) - 1.

Original entry on oeis.org

3, 5, 47, 1091, 172681
Offset: 1

Author

Mikk Heidemaa, Apr 28 2021

Keywords

Comments

a(n) != 13 (mod 20) and a(n) != 17 (mod 20). Proof: Write n=20*k + 13, and then show that n^2 + 1 == 0 (mod 5) and 3^(n+1) - 1 == 3 (mod 5). Because of its factor 5 the former cannot divide the latter. - Martin Ehrenstein, Jun 06 2021
a(6) > 10^14. - Martin Ehrenstein, Jun 18 2021

Crossrefs

Programs

  • Mathematica
    a[n_Integer] := Select[ Prime@ Range@n, PowerMod[3, # + 1, #^2 + 1] == 1 &]; a[2*10^5] (* or *)
    a[n_Integer] := If[ PrimeQ@n && Divisible[3^(n + 1) - 1, n^2 + 1] , Print@n]; Do[ a[n], {n, 2*10^5}]
  • Python
    from sympy import primerange
    def afind(limit):
      for p in primerange(1, limit+1):
        if pow(3, p+1, p**2+1) == 1: print(p, end=", ")
    afind(10**6) # Michael S. Branicky, May 03 2021

A331363 Pairs of coordinates of the corners in a counterclockwise triangular spiral.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, -2, -1, 3, -1, 0, 2, -4, -2, 5, -2, 0, 3, -6, -3, 7, -3, 0, 4, -8, -4, 9, -4, 0, 5, -10, -5, 11, -5, 0, 6, -12, -6, 13, -6, 0, 7, -14, -7, 15, -7, 0, 8, -16, -8, 17, -8, 0, 9, -18, -9, 19, -9, 0, 10, -20, -10, 21, -10, 0, 11
Offset: 1

Author

Mikk Heidemaa, May 03 2020

Keywords

Comments

Odd n yields the x- and even n the y-coordinates (i.e., x- and y-coordinates alternate in the sequence).

Examples

			X- and y-coordinates of the corners alternate in the sequence: 0, 0, 1, 0, 0, 1, -2,-1, 3, -1, ...
                      (0,4)
                     .     \
                    .       \
                   .         \
                      (0,3)   \
                     /     \   \
                    /       \   \
                   /         \   \
                  /   (0,2)   \   \
                 /   /     \   \   \
                /   /       \   \   \
               /   /         \   \   \
              /   /   (0,1)   \   \   \
             /   /   /     \   \   \   \
            /   /   /       \   \   \   \
           /   /   /         \   \   \   \
          /   /   /   (0,0)->(1,0)\   \   \
         /   /   /                 \   \   \
        /   /   /                   \   \   \
       /   /  (-2,-1)------------->(3,-1)\   \
      /   /                               \   \
     /   /                                 \   \
    /  (-4,-2)--------------------------->(5,-2)\
   /                                             \
  /                                               \
(-6,-3)------------------------------------------>(7,-3)
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Ceiling[1/18*n*(Mod[2 - n, 6] + 4*Mod[n, -3] + 1)]; Table[ a[n], {n, 66}] (* or *)
    LinearRecurrence[{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, -1}, {0, 0, 1, 0, 0, 1, -2, -1, 3, -1, 0, 2}, 66]

Formula

a(n) = ceiling(1/18*n*((2 - n) mod 6 + 4*n mod (-3) + 1)), for n >= 1.
x(n) = ceiling(n - 2/3*(n^2 + 1) mod 3), for n >= 1 (x-coordinates).
y(n) = floor(2*n/3)*((2 - n) mod (-3) + 1), for n >= 1 (y-coordinates).
From Colin Barker, May 03 2020: (Start)
G.f.: x^3*(1 + x^3 - 2*x^4 - x^5 + x^6 - x^7) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-6) - a(n-12) for n>12.
(End)
From Wolfdieter Lang, Jul 13 2020: (Start)
Bisection: x(k) = a(2*k-1). x(3+3*l) = 0, x(1+3*l) = -2*l, x(2+3*l) = 1+2*l, for l >= 0.
x(k) = (2*(k-1)*modp((k-4)^2,3) - (2*k-1)*modp((k-2)^2,3) + 1)/3, for k >= 1.
y(k) = a(2*k). y(3+3*k) = 1+l, y(1+3*k) = -l = y(2+3*k), for l >= 0.
y(k) = ((k-1)*modp((k-1)^2,3) + (k-2)*modp((k+1)^2,3) - k*modp(k^2,3) -(k-3))/3, k >= 1.
G.f.s: Gx(t) = t^2*(1 - 2*t^2 + t^3)/(1 - t^3)^2, and Gy(t) = t^3*(1 - t - t^2) / (1 - t^3)^2.
This produces the g.f. G(x) = Gy(x^2) + Gx(x^2)/x given by Colin Barker.
(End)

A329972 Y-coordinate of a point moving in a triangular spiral.

Original entry on oeis.org

0, 0, 1, 0, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 0, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -2, -1, 0, 1, 2, 3, 4, 3, 2, 1, 0, -1, -2, -3, -4
Offset: 0

Author

Mikk Heidemaa, Nov 26 2019

Keywords

Comments

A329116 gives x-coordinates for a point moving in counterclockwise triangular spiral.

Examples

			    y
     |
   4 |                         56
     |                           \
     |                            \
     |                             \
   3 |                         30  55
     |                         / \   \
     |                        /   \   \
     |                       /     \   \
   2 |                     31  12  29  54
     |                     /   / \   \   \
     |                    /   /   \   \   \
     |                   /   /     \   \   \
   1 |                 32  13   2  11  28  53
     |                 /   /   / \   \   \   \
     |                /   /   /   \   \   \   \
     |               /   /   /     \   \   \   \
   0 |             33  14   3   0---1  10  27  52
     |             /   /   /             \   \   \
     |            /   /   /               \   \   \
     |           /   /   /                 \   \   \
  -1 |         34  15   4---5---6---7---8---9  26  51
     |         /   /                             \   \
     |        /   /                               \   \
     |       /   /                                 \   \
  -2 |     35  16--17--18--19--20--21--22--23--24--25  50
     |     /                                             \
     |    /                                               \
     |   /                                                 \
  -3 | 36--37--38--39--40--41--42--43--44--45--46--47--48--49
     |
     +--------------------------------------------------------
   x:  -6  -5  -4  -3  -2  -1   0   1   2   3   4   5   6   7
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Table[Floor[Min[#*Max[0, 2*Mod[#, 2] - 2], -2*#*Mod[#, -1]] + Ceiling[-#/2]] &[Sqrt@ k], {k, 0, n}]; a[64]

Formula

a(n) = floor(min(s*max(((0, 2*s) mod 2) - 2), (-2*s*s) mod (-1)) + ceiling(-s/2)) where s=sqrt(n).

A329116 Successively count to (-1)^(n+1)*n (n = 0, 1, 2, ... ).

Original entry on oeis.org

0, 1, 0, -1, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8
Offset: 0

Author

Mikk Heidemaa, Nov 13 2019

Keywords

Comments

Also x-coordinates of a point moving in counterclockwise triangular spiral (A329972 gives the y-coordinates).

Examples

			   y
     |
   4 |                         56
     |                           \
     |                            \
     |                             \
   3 |                         30  55
     |                         / \   \
     |                        /   \   \
     |                       /     \   \
   2 |                     31  12  29  54
     |                     /   / \   \   \
     |                    /   /   \   \   \
     |                   /   /     \   \   \
   1 |                 32  13   2  11  28  53
     |                 /   /   / \   \   \   \
     |                /   /   /   \   \   \   \
     |               /   /   /     \   \   \   \
   0 |             33  14   3   0---1  10  27  52
     |             /   /   /             \   \   \
     |            /   /   /               \   \   \
     |           /   /   /                 \   \   \
  -1 |         34  15   4---5---6---7---8---9  26  51
     |         /   /                             \   \
     |        /   /                               \   \
     |       /   /                                 \   \
  -2 |     35  16--17--18--19--20--21--22--23--24--25  50
     |     /                                             \
     |    /                                               \
     |   /                                                 \
  -3 | 36--37--38--39--40--41--42--43--44--45--46--47--48--49
     |
     +--------------------------------------------------------
   x:  -6  -5  -4  -3  -2  -1   0   1   2   3   4   5   6   7
We count as follows. Start at n=0 with 0.
Next step is to count to 1: so we have 0, 1.
Next step is to count to -2, so we have 0, 1, 0, -1, -2.
Next we have to go to +3, so we have 0, 1, 0, -1, -2, -1, 0, 1, 2, 3.
And so on.
		

Crossrefs

Cf. A053615, A196199, A339265 (first differences). Essentially the same as A255175.

Programs

  • Mathematica
    a[n_] := Table[(-1)^(# + 1)*(-#^2 + # + k) &[Ceiling@ Sqrt@ k], {k, 0, n}]; a[64]
  • Python
    from math import isqrt
    def A329116(n): return ((t:=1+isqrt(n-1))*(t-1)-n)*(-1 if t&1 else 1) if n else 0 # Chai Wah Wu, Aug 04 2022

Formula

a(n) = (-1)^t * (t^2 - t - n) where t=ceiling(sqrt(n)).
a(n) = (-1)^t * floor(t^2 - sqrt(n) - n) where t=ceiling(sqrt(n)).
A053615(n) = abs(a(n)).
abs(A196199(n)) = abs(a(n)).
A255175(n) = a(n+1).

A308553 Numbers k such that 5^(k+3) + 3^(k+2) + 2^(k+1) + 1 is prime.

Original entry on oeis.org

0, 4, 8, 524, 972, 3780, 7704
Offset: 1

Author

Mikk Heidemaa, Jun 07 2019

Keywords

Comments

Larger k values yield probable primes.
a(8) > 100000 (if it exists). - Michael S. Branicky, Nov 11 2024

Crossrefs

Cf. A306573.

Programs

  • Mathematica
    ParallelTable[If[PrimeQ[5^(n+3) + 3^(n+2) + 2^(n+1) + 1], n, Nothing], {n, 0, 10^4}]