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: Doug Bell

Doug Bell's wiki page.

Doug Bell has authored 26 sequences. Here are the ten most recent ones:

A287688 Triangle read by rows: T(j,k) is the number of distinct edge segment pairs in a j X k rectangular grid.

Original entry on oeis.org

2, 6, 7, 10, 15, 13, 15, 21, 28, 22, 21, 28, 36, 45, 32, 28, 36, 45, 55, 66, 45, 36, 45, 55, 66, 78, 91, 59, 45, 55, 66, 78, 91, 105, 120, 76, 55, 66, 78, 91, 105, 120, 136, 153, 94, 66, 78, 91, 105, 120, 136, 153, 171, 190, 115, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 137
Offset: 1

Author

Doug Bell, May 29 2017

Keywords

Comments

This gives the number of pairs of edge segments that are distinct with respect to rotation and mirror images. Sequence is arranged so that j <= k (since 2 X 3 and 3 X 2 are equivalent grids), first by increasing j, then by increasing k: a(1) = 1 X 1 = 2, a(2) = 1 X 2 = 6, a(3) = 2 X 2 = 7, a(4) = 1 X 3 = 10.
Here j = A002260(n), k = A002024(n), and n = A000217(k-1) + j.
Where j != k, a(n) = A000217(j + k).
Where j = k, a(n) is approximately A236312(j-2); a(n) >= A236312(j-2).

Examples

			Triangle begins:
   2;
   6,  7;
  10, 15, 13;
  15, 21, 28, 22;
  21, 28, 36, 45, 32;
  28, 36, 45, 55, 66, 45;
  36, 45, 55, 66, 78, 91, 59;
...
For n = 3, the a(3) = 7 pairs of edge segments for a 2 X 2 rectangular grid are:
  + - - +     + * * +  + * - +  + * - +  + * - +  + * - +  + * - +  + * - +
  |     | --\ |     |  |     *  |     |  |     |  |     |  |     |  *     |
  |     | --/ |     |  |     |  |     *  |     |  |     |  *     |  |     |
  + - - +     + - - +, + - - +, + - - +, + - * +, + * - +, + - - +, + - - +.
		

Crossrefs

Cf. A002260, A002024, A000217, A236312. Distinct edge segments A287618.

A288626 Numbers n such that n * (x-1)/x produces a rotation of the digits in n for some value of x.

Original entry on oeis.org

54, 216, 324, 432, 540, 648, 756, 864, 918, 972, 2232, 4464, 4554, 5049, 5454, 5544, 6696, 7776, 8928, 9108, 11070, 19188, 21951, 22140, 22221, 29268, 33210, 38376, 43443, 43902, 44280, 44442, 55350, 56565, 57564, 58536, 65853, 66420, 66663, 73170, 76752, 77490, 77787, 80487, 81180, 86886, 87804
Offset: 1

Author

Doug Bell, Jun 11 2017

Keywords

Comments

Numbers n where n * (x-1)/x produces a rotation that would have a first digit of zero are omitted.
Where n * (x-1)/x produces a rotation, x is a factor of n.
The first term where more than one value of x produces a rotation for a(n) * (x-1)/x is a(47) = 87804: 87804 * 8/9 = 78048 and 87804 * 11/12 = 80487. The first term where more than two values of x produce a rotation is a(186) = 857142: 857142 * 1/2 = 428571, 857142 * 2/3 = 571428, and 857142 * 5/6 = 714285.
The first term where a(n) * (x-1)/x produces a rotation that itself appears in this sequence is a(4) = 432: 432 * 3/4 = 324 = a(3).
If all of the digits in a(n) <= 4, then a(n)*2 also appears; if all of the digits in a(n) <= 3, then a(n)*3 also appears; if all of the digits in a(n) <= 2, then a(n)*4 also appears. Similarly, if each of the digits in a(n) are a multiple of some number k, then a(n)/k also appears.
Where ABC represents the digits in a(n), then ABCABC, ABCABCABC, ... also appear in the sequence with the same value(s) of x.

Examples

			a(1) = 54, 54 * 5/6 = 45;
a(9) = 918, 918 * 33/34 = 891.
		

Crossrefs

Programs

  • Mathematica
    ok[n_] := Block[{d = IntegerDigits[n], m, trg, t}, m = Length[d]; trg = FromDigits /@ Select[ RotateLeft[d, #] & /@ Range[m-1], First[#] > 0 &]; {} != Select[ trg, (t = n/#; Numerator[t]== 1 + Denominator[t]) &]]; Select[ Range[10^5], ok] (* Giovanni Resta, Jun 14 2017 *)

A288669 Numbers n such that n * x/(x-1) produces a rotation of the digits in n for some value of x.

Original entry on oeis.org

45, 162, 243, 324, 405, 486, 567, 648, 729, 891, 2223, 4446, 4455, 4545, 4950, 5445, 6669, 7767, 8892, 8910, 10701, 18819, 19512, 21402, 22212, 26829, 32103, 37638, 39024, 42804, 43434, 44424, 53505, 53658, 56457, 56556, 58536, 64206, 66636, 70731, 74907, 75276, 77778, 78048
Offset: 1

Author

Doug Bell, Jun 13 2017

Keywords

Comments

Numbers n where n * x/(x-1) produces a rotation that would have a first digit of zero are omitted.
Where n * x/(x-1) produces a rotation, (x-1) is a factor of n.
The first term where more than one value of x produces a rotation for a(n) * x/(x-1) is a(44) = 78048: 78048 * 9/8 = 87804 and 78048 * 33/32 = 80487.
The first term where a(n) * x/(x-1) produces a rotation that itself appears in this sequence is a(3) = 243: 243 * 4/3 = 324 = a(4).
If all of the digits in a(n) <= 4, then a(n)*2 also appears; if all of the digits in a(n) <= 3, then a(n)*3 also appears; if all of the digits in a(n) <= 2, then a(n)*4 also appears. Similarly, if each of the digits in a(n) are a multiple of some number k, then a(n)/k also appears.
Where ABC represents the digits in a(n), then ABCABC, ABCABCABC, ... also appear in the sequence with the same value(s) of x.

Examples

			a(1) = 45, 45 * 6/5 = 54;
a(11) = 2223, 2223 * 248/247 = 2232.
		

Crossrefs

Programs

  • Mathematica
    ok[n_] := Block[{d = IntegerDigits[n], m, trg, t}, m = Length[d]; trg = FromDigits /@ Select[ RotateLeft[d, #] & /@ Range[m-1], First[#] > 0 &];{} != Select[ trg, (t = n/#; Numerator[t] + 1 == Denominator[t]) &]]; Select[ Range[10^5], ok] (* Giovanni Resta, Jun 14 2017 *)

A285936 Number of rotations of the digits in n produced by n * x/y where x != y.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 2
Offset: 10

Author

Doug Bell, Jun 14 2017

Keywords

Comments

Rotations with a leading digit of zero are omitted.
If d is the number of nonzero digits in n, a(n) < d.

Examples

			a(13) = 0 because there is no fraction x/y such that 13 * x/y = 31, the only rotation of 13;
a(15) = 1 because 15 * 17/5 = 51, the only rotation 51;
a(114) = 2 because 114 * 47/38 = 141 and 114 * 137/38 = 411, both the rotations of 114.
		

A287618 Triangle read by rows: T(j,k) is the number of distinct edge segments in a j X k rectangular grid.

Original entry on oeis.org

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

Author

Doug Bell, May 28 2017

Keywords

Comments

This gives the number of edge segments that are distinct with respect to rotation and mirror images. Sequence is arranged so that j <= k (since 2 X 3 and 3 X 2 are equivalent grids), first by increasing j, then by increasing k: a(1) = 1 X 1 = 1, a(2) = 1 X 2 = 2, a(3) = 2 X 2 = 1, a(4) = 1 X 3 = 3.
Here j = A002260(n), k = A002024(n), and n = A000217(k-1) + j, then a(n) = if j = k, ceiling(j/2), else ceiling(j/2) + ceiling(k/2).

Examples

			Triangle begins:
  1;
  2, 1;
  3, 3, 2;
  3, 3, 4, 2;
  4, 4, 5, 5, 3;
  4, 4, 5, 5, 6, 3;
  5, 5, 6, 6, 7, 7, 4;
...
For n = 9, the a(9) = 4 distinct edge segments [A,B,C,D] for a 3 X 4 rectangular grid are:
  + - - - - +       + A B B A +
  |         |       C         C
  |         |  -->  D         D
  |         |       C         C
  + - - - - +       + A B B A +.
		

Crossrefs

Cf. A287688 (number of distinct edge segment pairs).

Programs

  • Mathematica
    Table[Ceiling[j/2] + Boole[j != k] Ceiling[k/2], {j, 14}, {k, j}] // Flatten (* Michael De Vlieger, Jun 09 2017 *)

A259362 a(1) = 1, for n > 1: a(n) is the number of ways to write n as a nontrivial perfect power.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0
Offset: 1

Author

Doug Bell, Jun 24 2015

Keywords

Comments

a(n) = number of integer pairs (i,j) for distinct values of i where i > 0, j > 1 and n = i^j. Since 1 = 1^r for all real values of r, the requirement for a distinct i causes a(1) = 1 instead of a(1) = infinity.
Alternatively, the sequence can be defined as: a(1) = 1, for n > 1: a(n) = number of pairs (i,j) such that i > 0, j > 1 and n = i^j.
A007916 = n, where a(n) = 0.
A001597 = n, where a(n) > 0.
A175082 = n, where n = 1 or a(n) = 0.
A117453 = n, where n = 1 or a(n) > 1.
A175065 = n, where n > 1 and a(n) > 0 and this is the first occurrence in this sequence of a(n).
A072103 = n repeated a(n) times where n > 1.
A075802 = min(1, a(n)).
A175066 = a(n), where n = 1 or a(n) > 1. This sequence is an expansion of A175066.
A253642 = 0 followed by a(n), where n > 1 and a(n) > 0.
A175064 = a(1) followed by a(n) + 1, where n > 1 and a(n) > 0.
Where n > 1, A001597(x) = n (which implies a(n) > 0), i = A025478(x) and j = A253641(n), then a(n) = A000005(j) - 1, which is the number of factors of j greater than 1. The integer pair (i,j) comprises the smallest value i and the largest value j where i > 0, j > 1 and n = i^j. The a(n) pairs of (a,b) where a > 0, b > 1 and n = a^b are formed with b = each of the a(n) factors of j greater than 1. Examples for n = {8,4096}:
a(8) = 1, A001597(3) = 8, A025478(3) = 2, A253641(8) = 3, 8 = 2^3 and A000005(3) - 1 = 1 because there is one factor of 3 greater than 1 [3]. The set of pairs (a,b) is {(2,3)}.
a(4096) = 5, A001597(82) = 4096, A025478(82) = 2, A253641(4096) = 12, 4096 = 2^12 and A000005(12) - 1 = 5 because there are five factors of 12 greater than 1 [2,3,4,6,12]. The set of pairs (a,b) is {(64,2),(16,3),(8,4),(4,6),(2,12)}.
A023055 = the ordered list of x+1 with duplicates removed, where x is the number of consecutive zeros appearing in this sequence between any two nonzero terms.
A070428(x) = number of terms a(n) > 0 where n <= 10^x.
a(n) <= A188585(n).

Examples

			a(6) = 0 because there is no way to write 6 as a nontrivial perfect power.
a(9) = 1 because there is one way to write 9 as a nontrivial perfect power: 3^2.
a(16) = 2 because there are two ways to write 16 as a nontrivial perfect power: 2^4, 4^2.
From _Friedjof Tellkamp_, Jun 14 2025: (Start)
n:       1, 2, 3, 4, 5, 6, 7, 8, 9, ...
Squares: 1, 0, 0, 1, 0, 0, 0, 0, 1, ... (A010052)
Cubes:   1, 0, 0, 0, 0, 0, 0, 1, 0, ... (A010057)
...
Sum:    oo, 0, 0, 1, 0, 0, 0, 1, 1, ...
a(1)=1:  1, 0, 0, 1, 0, 0, 0, 1, 1, ... (= this sequence). (End)
		

Programs

  • Mathematica
    a[n_] := If[n == 1, 1, Sum[Boole[IntegerQ[n^(1/k)]], {k, 2, Floor[Log[2, n]]}]]; Array[a, 100] (* Friedjof Tellkamp, Jun 14 2025 *)
    a[n_] := If[n == 1, 1, DivisorSigma[0, Apply[GCD, Transpose[FactorInteger[n]][[2]]]] - 1]; Array[a, 100] (* Michael Shamos, Jul 06 2025 *)
  • PARI
    a(n) = if (n==1, 1, sum(i=2, logint(n, 2), ispower(n, i))); \\ Michel Marcus, Apr 11 2025

Formula

a(1) = 1, for n > 1: a(n) = A000005(A253641(n)) - 1.
If n not in A001597, then a(n) = 0, otherwise a(n) = A175064(x) - 1 where A001597(x) = n.
From Friedjof Tellkamp, Jun 14 2025: (Start)
a(n) = A089723(n) - 1, for n > 1.
a(n) = A010052(n) + A010057(n) + A374016(n) + (...), for n > 1.
Sum_{k>=2..n} a(k) = A089361(n), for n > 1.
G.f.: x + Sum_{j>=2, k>=2} x^(j^k).
Dirichlet g.f.: 1 + Sum_{k>=2} zeta(k*s)-1. (End)

A259299 The decimal expansion of n/(n+1) until it terminates or repeats, shown without the decimal point.

Original entry on oeis.org

0, 5, 6, 75, 8, 83, 857142, 875, 8, 9, 90, 916, 923076, 9285714, 93, 9375, 9411764705882352, 94, 947368421052631578, 95, 952380, 954, 9565217391304347826086, 9583, 96, 9615384, 962, 96428571, 9655172413793103448275862068, 96, 967741935483870, 96875, 96, 97058823529411764, 9714285, 972, 972
Offset: 0

Author

Doug Bell, Jun 23 2015

Keywords

Comments

The first occurrence of a repeated term where a(n) = a(n+1) is for a(35) and a(36), both of which equal 972. This results from two different repeating decimals with different length repeating periods but the same non-repeating plus repeating digits, namely 35/36 = .972222... = 972 (repeating period of 1) and 36/37 = .972972... = 972 (repeating period of 3).
Other than n = (36,37) the only repeated terms appear to follow one of the following two patterns for the larger value of n:
First pattern: for n >= 111, where all digits of n are 1: 111, 1111, 11111, ... and a(n-1) = a(n) = 990, 9990, 99990, ... with the repeating decimal for ((n-1)/n, n/(n+1)) of (.9909090..., .990990990...), (.9990990990..., .999099909990...), (.9999099909990..., .999909999099990...). Where d is the number of digits in a(n), the repeating period for the decimal values is (d-1, d).
Second pattern: for n >= 10101, where the digits of n alternate between 0 and 1, with a final digit of 1: 10101, 1010101, 101010101, ... and a(n-1) = a(n) = 999900, 9999900, 99999900, ... with the repeating decimal for ((n-1)/n, n/(n+1)) of (.99990099009900..., .999900999900999900...), (.99999009990099900..., .999990099999009999900...), (.99999900999900999900..., .999999009999990099999900...). Where d is the number of digits in a(n), the repeating period for the decimal values is (d-2, d).
Have verified that there are no other repeating terms up to n = 10^6.

Examples

			a(1)=5 (1/2=0.5), a(2)=6 (2/3=0.6666...=6), a(3)=75 (3/4=0.75=75).
		

Crossrefs

Subsequences A156703, A235589.

Programs

  • Mathematica
    Array[FromDigits@ Flatten@ First@ RealDigits[(# - 1)/#] &, 37] (* Michael De Vlieger, Aug 18 2015 *)

A259254 Number of partitions of prime(n) into n primes.

Original entry on oeis.org

1, 0, 0, 0, 1, 1, 2, 2, 3, 7, 7, 12, 19, 19, 25, 44, 72, 72, 119, 147, 152, 234, 292, 435, 777, 920, 946, 1135, 1161, 1377, 3703, 4294, 5944, 5944, 10742, 10742, 14488, 18958, 22092, 28662, 37687, 37687, 63068, 63068, 72400, 72400, 132756, 233796, 265315, 265315
Offset: 1

Author

Doug Bell, Jun 22 2015

Keywords

Comments

a(n) = number of partitions of A000040(n) into n primes.
If n > 1 and prime(n) - prime(n-1) = 2 (twin primes), then the number of partitions of prime(n) into n primes that don't contain 2 is equal to a(n) - a(n-1); every partition of primes in a(n) that does contain a 2 matches a partition of primes in a(n-1) with an added partition for 2. Further, if n is even, then a(n) = a(n-1).

Examples

			a(9) = 3 because 23 is the ninth prime number (A000040(9) = 23), and 23 can be partitioned into nine primes in three ways: [2,2,2,2,2,2,2,2,7], [2,2,2,2,2,2,3,3,5] and [2,2,2,2,3,3,3,3,3].
		

Crossrefs

Subsequence of A117278.
Cf. A000040.

Programs

  • Maple
    N:= 100:  # to get a(1) to a(N)
    Primes:= [seq(ithprime(i),i=1..N)]:
    W:= proc(n,m,j) option remember;
      if n < 0 then return 0 fi;
      if n=0 then if m=0 then return 1 else return 0 fi fi;
      add(W(n-Primes[i],m-1,i),i=1..j)
    end proc:
    seq(W(Primes[n],n,n), n = 1 .. N); # Robert Israel, Jun 22 2015
  • Mathematica
    f[n_] := Length@ IntegerPartitions[ Prime@n, {n}, Prime@ Range@ n]; Array[f, 50] (* Giovanni Resta, Jun 23 2015 *)
  • PARI
    a(n) = {nb = 0; forpart(p=prime(n), ok=1; for (k=1, n, if (!isprime(p[k]), ok=0; break));nb += ok,[2,prime(n)],[n,n]); nb;} \\ Michel Marcus, Jun 23 2015
    
  • Perl
    use ntheory ":all"; use List::MoreUtils qw/all/; sub a259254 { my($n,$sum)=(shift,0); forpart { $sum++ if all { is_prime($) } @; } nth_prime($n),{n=>$n,amin=>2}; $sum; } say a259254($) for 1..60; # _Dana Jacobsen, Dec 15 2015
    
  • Perl
    use ntheory ":all";
    use Memoize;  memoize 'W';
    sub W {
      my($n, $m, $j) = @_;
      return 0 if $n < 0;
      return ($m == 0) ? 1 : 0  if $n == 0;
      vecsum( map { W($n-nth_prime($), $m-1, $) } 1 .. $j );
    }
    sub A259254 { my $n = shift; W(nth_prime($n), $n, $n); }
    print "$A259254($"> ", A259254($),"\n" for 1..60; # Dana Jacobsen, Dec 15 2015

Formula

a(n) = A117278(A000040(n),n). - Robert Israel, Jun 22 2015

A259194 Number of partitions of n into four primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 2, 3, 3, 4, 4, 6, 3, 6, 5, 7, 5, 9, 5, 11, 7, 11, 7, 13, 6, 14, 9, 15, 8, 18, 9, 21, 10, 19, 11, 24, 10, 26, 12, 26, 13, 30, 12, 34, 15, 33, 16, 38, 14, 41, 17, 41, 16, 45, 16, 50, 19, 47, 21, 56, 20, 61, 20, 57
Offset: 0

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(17) = 3 because 17 can be written as the sum of four primes in exactly three ways: 2+2+2+11, 2+3+5+7 and 2+5+5+5.
		

Crossrefs

Column k=4 of A117278.
Number of partitions of n into r primes for r = 1..10: A010051, A061358, A068307, this sequence, A259195, A259196, A259197, A259198, A259200, A259201.
Cf. A000040.

Programs

Formula

a(n) = Sum_{k=1..floor(n/4)} Sum_{j=k..floor((n-k)/3)} Sum_{i=j..floor((n-j-k)/2)} A010051(i) * A010051(j) * A010051(k) * A010051(n-i-j-k). - Wesley Ivan Hurt, Apr 17 2019
a(n) = [x^n y^4] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019

A259195 Number of partitions of n into five primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 5, 4, 6, 6, 7, 6, 10, 7, 11, 9, 12, 11, 17, 11, 18, 13, 20, 14, 24, 15, 27, 18, 29, 21, 35, 19, 38, 24, 41, 26, 47, 26, 53, 30, 54, 34, 64, 33, 70, 38, 73, 41, 81, 41, 89, 45, 92, 50, 103, 47, 112, 56, 117, 61, 127, 57
Offset: 0

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(17) = 3 because 17 can be written as the sum of five primes in exactly three ways: 2+2+3+3+7, 2+2+3+5+5, and 3+3+3+3+5.
		

Crossrefs

Column k=5 of A117278.
Number of partitions of n into r primes for r = 1..10: A010051, A061358, A068307, A259194, this sequence, A259196, A259197, A259198, A259200, A259201.
Cf. A000040.

Programs

Formula

a(n) = Sum_{l=1..floor(n/5)} Sum_{k=l..floor((n-l)/4)} Sum_{j=k..floor((n-k-l)/3)} Sum_{i=j..floor((n-j-k-l)/2)} c(i) * c(j) * c(k) * c(l) * c(n-i-j-k-l), where c = A010051. - Wesley Ivan Hurt, Apr 17 2019
a(n) = [x^n y^5] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019

Extensions

More terms from David A. Corneth, Sep 06 2020