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: James C. McMahon

James C. McMahon's wiki page.

James C. McMahon has authored 40 sequences. Here are the ten most recent ones:

A385454 Difference of the largest and smallest semiperimeters of an integral rectangle with area n.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 3, 4, 4, 0, 6, 0, 6, 8, 9, 0, 10, 0, 12, 12, 10, 0, 15, 16, 12, 16, 18, 0, 20, 0, 21, 20, 16, 24, 25, 0, 18, 24, 28, 0, 30, 0, 30, 32, 22, 0, 35, 36, 36, 32, 36, 0, 40, 40, 42, 36, 28, 0, 45, 0, 30, 48, 49, 48, 50, 0, 48, 44, 54, 0, 56, 0
Offset: 1

Author

James C. McMahon, Jun 29 2025

Keywords

Comments

For all noncomposite n, a(n) = 0.
For each square k^2, a(k^2) = (k^2 + 1) - 2*k = (k-1)^2.

Examples

			The largest semiperimeter of an integral rectangle with area 9 is 10 (1 x 9 rectangle); the smallest semiperimeter is 6 (3 x 3 rectangle). The difference, a(9) = 4.
		

Crossrefs

Cf. A063655.

Programs

  • Mathematica
    a[n_]:=1+n-2Median[Divisors[n]];Array[a,73]
  • Python
    from sympy import divisors
    def A385454(n):
        l = len(d:=divisors(n))
        return n+1-d[l-1>>1]-d[l>>1] # Chai Wah Wu, Jul 01 2025

Formula

a(n) = 1 + n - A063655(n).

A385288 Numbers with a prime number of prime factors, counted with multiplicity, and whose prime factors are each raised to a prime exponent.

Original entry on oeis.org

4, 8, 9, 25, 27, 32, 49, 72, 108, 121, 125, 128, 169, 200, 243, 288, 289, 343, 361, 392, 500, 529, 675, 800, 841, 961, 968, 972, 1125, 1323, 1331, 1352, 1369, 1372, 1568, 1681, 1800, 1849, 2048, 2187, 2197, 2209, 2312, 2700, 2809, 2888, 3087, 3125, 3267, 3481
Offset: 1

Author

James C. McMahon, Jun 24 2025

Keywords

Comments

a(n) = A114129(n) through n=25; then a(26) = 961 and A114129(26) = 864.
Subset of A056166.
Subset of A001694. - Michael De Vlieger, Jun 25 2025.

Examples

			200 = 2^3 * 5^2; 200 has a prime number of prime factors, counted with multiplicity (3 + 2 = 5), and exponents 3 and 2 are prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^4],AllTrue[Last/@FactorInteger[#],PrimeQ]&&PrimeQ[PrimeOmega[#]]&]
  • PARI
    isok(k) = my(f=factor(k)); isprime(bigomega(k)) && (sum(k=1, #f~, isprime(f[k,2])) == omega(f)); \\ Michel Marcus, Jun 25 2025

A383816 Palindromic primes which satisfy the requirements of A380943 in at least two ways.

Original entry on oeis.org

373, 1793971, 7933397, 374636473, 714707417, 727939727, 787333787, 790585097, 947939749, 991999199, 10253935201, 11365556311, 11932823911, 13127372131, 34390609343, 35369996353, 35381318353, 36297179263, 37018281073, 37423332473, 37773537773, 38233333283, 38914541983, 39064546093
Offset: 1

Author

Keywords

Comments

Terms of A380943 are primes whose decimal representation is the concatenation of primes p and q such that the concatenation of q and p also forms a prime.

Examples

			The palindromic prime 373 meets the requirements of A380943 in two ways: the concatenation of 3 and 37 forms the prime 337, and the concatenation of 73 and 3 forms the prime 733.
Although 37673 is a palindrome where 3, 7673, and 76733 are all primes and 3767, 3, and 33767 are all primes, the palindrome is not prime and is therefore not in the sequence.
		

Crossrefs

Subsequence of A383810.

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[Join[q, p]]; If[ PrimeQ@ FromDigits@ p && PrimeQ@ FromDigits@ q && PrimeQ@ qp && IntegerLength@ qp == len, cnt++]; k++]; cnt]; fQ[n_] := Reverse[idn = IntegerDigits@ n] == idn && f@ n > 1; Select[ Prime@ Range@ 3000000, fQ]

A383815 Palindromic primes in A380943.

Original entry on oeis.org

313, 373, 797, 11311, 13331, 13931, 17971, 19991, 31013, 35353, 36263, 36563, 38783, 71317, 79397, 97379, 98389, 1129211, 1196911, 1611161, 1793971, 1982891, 3106013, 3166613, 3193913, 3236323, 3288823, 3304033, 3319133, 3329233, 3365633, 3417143, 3447443, 3449443, 3515153, 3670763
Offset: 1

Author

Keywords

Comments

A380943 requires that primes, p_n, written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.
Intersection of A002385 and A380943.

Examples

			The palindromic prime 313 is formed by the concatenation of the primes 31 and 3, which reversed, also form the prime 331. The palindromic prime 13931 is formed by the concatenation of 139 and 31; 31139 is also prime.
		

Programs

  • Maple
    rev:= proc(n) local L,i;
       L:= convert(n,base,10);
       add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(x,y) y + 10^(ilog10(y)+1)*x end proc:
    filter:= proc(z) local i,x,y;
      if not isprime(z) then return false fi;
      for i from 1 to ilog10(z) do
        x:= z mod 10^i;
        if x < 10^(i-1) then next fi;
        y:= (z-x)/10^i;
        if isprime(x) and isprime(y) and isprime(tcat(x,y)) then return true fi;
      od;
      false
    end proc:
    N:= 7: # for terms of up to 7 digits
    R:= NULL:
    for d from 1 to (N-1)/2 do
      for x from 10^(d-1) to 10^d-1 do
        for y from 0 to 9 do
          z:= rev(x) + 10^d * y + 10^(d+1)*x;
          if filter(z) then R:= R,z fi
    od od od:
    R;  # Robert Israel, Jun 08 2025
  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[Join[q, p]]; If[ PrimeQ@ FromDigits@ p && PrimeQ@ FromDigits@ q && PrimeQ@ qp && IntegerLength@ qp == len, cnt++]; k++]; cnt]; fQ[n_] := Reverse[idn = IntegerDigits@ n] == idn && f@ n > 0; Select[ Prime@ Range@ 264000, fQ]

A383814 Least number which satisfies the requirements of A380943 in exactly n ways.

Original entry on oeis.org

2, 37, 373, 19937, 257931013, 4199993923
Offset: 0

Author

Keywords

Comments

The requirements of A380943 are that primes, p_n, written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.

Examples

			See the examples in A383810 through A383813.
		

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[ Join[q, p]]; If[ PrimeQ[FromDigits[p]] && PrimeQ[FromDigits[q]] && PrimeQ[qp] && IntegerLength[qp] == len, cnt++]; k++]; cnt];a[n_]:=Module[{k=1},While[f[Prime[k]]!=n,k++];Prime[k]];Array[a,4,0]

A383813 Primes which satisfy the requirements of A380943 in exactly four ways.

Original entry on oeis.org

257931013, 1394821313, 2699357347, 3122419127, 3132143093, 3647381953, 3736320359, 3799933727, 6130099337, 7622281937, 7943701397, 7991407367
Offset: 1

Author

Keywords

Comments

The requirements of A380943 are that primes, p_n, written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.
The number of terms <= 10^k beginning with k=1: 0, 0, 0, 0, 0, 0, 0, 1, 12, ..., .

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[ Join[q, p]]; If[ PrimeQ[FromDigits[p]] && PrimeQ[FromDigits[q]] && PrimeQ[qp] && IntegerLength[qp] == len, cnt++]; k++]; cnt];Select[ Prime@ Range@ 10000000, f@# == 4 &]

A383812 Primes which satisfy the requirements of A380943 in exactly three ways.

Original entry on oeis.org

19937, 103997, 377477, 577937, 738677, 739397, 877937, 2116397, 3110273, 3314513, 3343337, 3634313, 3833359, 5935393, 7147397, 7276337, 7511033, 7699157, 7723337, 11816911, 14713613, 19132213, 19132693, 19998779, 22739317, 23201359, 31189757, 31614377, 31669931, 31687151
Offset: 1

Author

Keywords

Comments

The requirements of A380943 are that primes, p_n, written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.
The number of terms <= 10^k beginning with k=1: 0, 0, 0, 0, 1, 7, 19, 70, 299, 1872, ..., .

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[ Join[q, p]]; If[ PrimeQ[FromDigits[p]] && PrimeQ[FromDigits[q]] && PrimeQ[qp] && IntegerLength[qp] == len, cnt++]; k++]; cnt];Select[ Prime@ Range@ 1980000, f@# == 3 &]

A383811 Primes which satisfy the requirements of A380943 in exactly two ways.

Original entry on oeis.org

373, 1913, 3733, 6737, 7937, 11353, 13997, 19997, 23773, 24113, 29347, 31181, 31193, 31907, 34729, 37277, 38237, 41593, 47293, 59929, 71971, 72719, 73823, 74177, 79337, 79613, 82373, 83773, 83911, 88397, 100913, 111773, 111973, 118171, 118273, 118747, 132113, 132137, 139547
Offset: 1

Author

Keywords

Comments

The requirements of A380943 are that primes, p_n, written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.

Examples

			373 is a member since 373 is the 74th prime, p=3 and q=73, and the reverse concatenation is 733 which is the 130th prime. In another way, p=37 and q=3, and the reverse concatenation is 337, the 68th prime.
		

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[ Join[q, p]]; If[ PrimeQ[FromDigits[p]] && PrimeQ[FromDigits[q]] && PrimeQ[qp] && IntegerLength[qp] == len, cnt++]; k++]; cnt];Select[ Prime@ Range@ 13000, f@# == 2 &]

A383810 Primes which satisfy the requirements of A380943 in more than one way.

Original entry on oeis.org

373, 1913, 3733, 6737, 7937, 11353, 13997, 19937, 19997, 23773, 24113, 29347, 31181, 31193, 31907, 34729, 37277, 38237, 41593, 47293, 59929, 71971, 72719, 73823, 74177, 79337, 79613, 82373, 83773, 83911, 88397, 100913, 103997
Offset: 1

Author

Keywords

Comments

The requirements of A380943 are that primes, written in decimal representation by the concatenation of primes p and q such that the concatenation of q and p also forms a prime.
The number of terms <= 10^k beginning with k=1: 0, 0, 1, 5, 31, 285, 930, 5625, 28137, 205416, ....

Examples

			373 is a member since 373 is the 74th prime, p=3 and q=73, and the reverse concatenation is 733 which is the 130th prime. In another way, p=37 and q=3 and the reverse concatenation is 337, the 68th prime.
		

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[ Join[q, p]]; If[ PrimeQ[FromDigits[p]] && PrimeQ[FromDigits[q]] && PrimeQ[qp] && IntegerLength[qp] == len, cnt++]; k++]; cnt]; Select[ Prime@ Range@ 10000, f@# > 1 &]

A381246 Largest value in trajectory of n under the juggler map of A380891.

Original entry on oeis.org

1, 2, 4, 4, 8, 6, 30, 8, 18, 10, 24, 12, 30, 14, 36, 16, 150, 18, 50, 20, 1320, 22, 43366048, 24, 41678, 26, 350, 28, 41678, 30, 234421146, 32, 2438232, 34, 114, 36, 5184, 38, 132, 40, 124026, 42, 150, 44, 160, 46, 934, 48, 1008, 50, 1084, 52, 43366048, 54, 1240
Offset: 1

Author

James C. McMahon and Vikram Prasad, Apr 17 2025

Keywords

Comments

A380891(x) map is If x mod 2 = 0 then a(x) = floor(x^(1/3)) else a(x) = floor(x^(4/3)).

Crossrefs

Programs

  • Mathematica
    fj[n_]:=If[Mod[n,2]==0,Floor[Surd[n,3]],Floor[n^(4/3)]];a381246[n_]:=Max[Delete[FixedPointList[fj, n], -1]];Array[a381246,55]
  • Python
    import sys
    import gmpy2
    sys.set_int_max_str_digits(0)
    def floorJuggler(n):
        a=n
        max=n
        while a > 1:
            b=0
            if a%2 == 0:
                b1=gmpy2.iroot(a,3)
                b=b1[0]
            else:
                b1=gmpy2.iroot(a**4,3)
                b=b1[0]
            a=b
            if a > max:
                max = a
        return max
    maxcount=0
    for i in range (1, 100):
        print (i, floorJuggler(i))