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: Antoine Mathys

Antoine Mathys's wiki page.

Antoine Mathys has authored 4 sequences.

A372223 Numbers in a hexagonal tiling (seen as concentric rings) which have exactly three neighbors whose difference from it is prime.

Original entry on oeis.org

1, 2, 8, 19, 20, 37, 61, 128, 217, 271, 398, 919, 1519, 1520, 2978, 3170, 4220, 4447, 4681, 5677, 5941, 6488, 8269, 9920, 10621, 12481, 16651, 17558, 22448, 26227, 29701, 34028, 34669, 35317, 35971, 56719, 60920, 61777, 74419, 75367, 80197, 88238, 93458
Offset: 1

Author

Antoine Mathys, Apr 22 2024

Keywords

Comments

A hexagonal tile with number 1 is surrounded by a ring of six hexagonal tiles, starting on the right and numbering the tiles 2 to 7 in a counterclockwise direction. New rings are added in the same fashion, with the next rings being numbered 8 to 19, 20 to 37, and so on (see the illustration below). By finding the difference between tile n and each of its six neighbors we shall define PD(n) to be the number of those differences which are prime. For example, working counter-clockwise around tile 8 the differences are 12, 13, 1, 6, 11, and 29. So PD(8)=3. In the same way, the differences around tile 17 are 1, 10, 11, 1, 16, and 17, hence PD(17) = 2. It can be shown that the maximum value of PD(n) is 3. This sequence lists all tiles for which PD(n)=3 in ascending order.
It can be shown that only the first and last tile of every ring need to be considered.

Examples

			For tile 1, the differences are 1,2,3,4,5,6, thus PD(1)=3 and a(1)=1.
For tile 2, the differences are 6,7,1,1,5,17, thus PD(2)=3 and a(2)=2.
For tile 3, the differences are 6,7,8,1,2,1, thus PD(3)=2 and 3 is not in the list.
Similarly, we see that PD(4)=2, PD(5)=0, PD(6)=2, PD(7)=2, and PD(8)=3. Thus the next term is a(3)=8.
        26--25--24--23
       /             \
      27  12--11--10  22
     /   /         \   \
   28  13   4---3   9  21
   /   /   /     \   \   \
  29  14   5  1  2    8  20
   \   \   \     /    /   /
   30  15   6---7    19 37
    \    \          /   /
     31   16--17--18  36
      \               /
       32---33--34--35
.
		

A373709 Partial sums of A119387.

Original entry on oeis.org

0, 0, 1, 1, 3, 4, 6, 6, 9, 11, 14, 15, 18, 20, 23, 23, 27, 30, 34, 36, 40, 43, 47, 48, 52, 55, 59, 61, 65, 68, 72, 72, 77, 81, 86, 89, 94, 98, 103, 105, 110, 114, 119, 122, 127, 131, 136, 137, 142, 146, 151, 154, 159, 163, 168, 170, 175, 179, 184, 187, 192
Offset: 0

Author

Antoine Mathys, Jun 14 2024

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0,
          a(n-1)+ilog2(n+1)-padic[ordp](n+1, 2))
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Jun 23 2024
  • Mathematica
    Accumulate[Table[BitLength[k] - 1 - IntegerExponent[k, 2], {k, 100}]] (* Paolo Xausa, Oct 01 2024 *)
  • PARI
    bit_width(n)=logint(n,2)+1;
    a(n)=my(d=bit_width(n+1),p=hammingweight(n+1));(n+2)*d-2*n-2^d+p-1;

Formula

a(n) = Sum_{m = 0..n} A119387(m).
a(n) = (n+2)*d - 2*n - 2^d + p - 1, with d = bit_width(n+1) = A070939(n+1) and p = popcount(n+1) = A000120(n+1).
a(n) = A001855(n+2) - A005187(n+1).

A372897 Count of n-digit numbers whose sum of digits is a prime.

Original entry on oeis.org

4, 33, 303, 2670, 23741, 222638, 2211826, 22325173, 220321667, 2128051302, 20606839279, 203631013986, 2048538361591, 20655036405780, 205672896661755, 2012878671315492, 19505453673514959, 190027534666354756, 1884928265282803982, 19032829919297816897, 193085599933330233795
Offset: 1

Author

Antoine Mathys, May 15 2024

Keywords

Comments

a(n) is the number of terms in A028834 with n digits.
Sum of digits s in n digits is a composition of s into n parts the first of which ranges 1 to 9 and the rest 0 to 9. The number of such compositions is the coefficient of x^s in polynomial (x^1 + ... + x^9)*(x^0 + ... + x^9)^(n-1) and a(n) is the sum of those coefficients where s is prime. - Kevin Ryde, May 19 2024
a(554) is the first term for which number_of_digits(a(n)) != n. - Antoine Mathys, May 22 2024

Examples

			For n=1 the a(1)=4 numbers are 2,3,5,7.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[Coefficient[Sum[x^i,{i,9}]Sum[x^i,{i,0,9}]^(n-1),x^i],{i,Prime[Range[PrimePi[9n]]]}]; Array[a,21] (* Stefano Spezia, May 16 2024 *)
  • PARI
    a(n)=my(p=sum(i=1,9,x^i)*sum(i=0,9,x^i)^(n-1),s=0);forprime(q=2,9*n,s+=polcoef(p,q));s;

Extensions

a(12)-a(21) from Stefano Spezia, May 16 2024

A322163 Minimal number of steps needed to get from n to 1, where for n > 1 the next step is to either n-1 or max(a,b) for any a > 1 and b > 1 such that ab=n.

Original entry on oeis.org

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

Author

Antoine Mathys, Nov 29 2018

Keywords

Examples

			For n=1, there is nothing to do. Hence a(1)=0.
For n=4, the possible sequences of steps are 4->3->2->1 and 4->2->1. Thus the minimal number of steps needed to reach 1 is a(4)=2.
For n=6, the possible sequences of steps are 6->5->4->3->2->1, 6->5->4->2->1 and 6->3->2->1. Thus the minimal number of steps needed to reach 1 is a(6)=3.
		

Programs

  • C
    #include 
    int main ()
    {
        const int N = 100;
        int steps[N + 1];
        steps[1] = 0;
        for (int n = 2; n <= N; n++) {
            int next = n - 1;
            for (int i = n - 1; i * i >= n; i--) {
                if (n % i == 0) {
                    if (steps[i] < steps[next]) {
                        next = i;
                    }
                }
            }
            steps[n] = 1 + steps[next];
        }
        for (int n = 1; n <= N; n++) {
            printf ("%d %d\n", n, steps[n]);
        }
    }
    
  • Mathematica
    divs[n_] := Append[Select[Most[Divisors[n]], #>= Sqrt[n] &], n-1]; a[0] = 0; a[1] = 0; a[n_] := a[n] = 1 + Min[a/@divs[n]]; Array[a, 100] (* Amiram Eldar, Nov 29 2018 *)
  • PARI
    seq(n)={my(v=vector(n)); for(n=2, n, my(m=v[n-1]); fordiv(n, d, if(d>=n/d && dAndrew Howroyd, Nov 29 2018