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.

Showing 1-4 of 4 results.

A224380 Table read by antidiagonals of numbers of form (2^n -1)*2^(m+2) + 3 where n>=1, m>=1.

Original entry on oeis.org

11, 19, 27, 35, 51, 59, 67, 99, 115, 123, 131, 195, 227, 243, 251, 259, 387, 451, 483, 499, 507, 515, 771, 899, 963, 995, 1011, 1019, 1027, 1539, 1795, 1923, 1987, 2019, 2035, 2043, 2051, 3075, 3587, 3843, 3971, 4035, 4067, 4083, 4091, 4099, 6147, 7171, 7683, 7939, 8067, 8131, 8163, 8179
Offset: 1

Views

Author

Brad Clardy, Apr 05 2013

Keywords

Comments

The table has row labels 2^n - 1 and column labels 2^(m+2). The table entry is row*col + 3. A MAGMA program is provided that generates the numbers in a table format. The sequence is read along the antidiagonals starting from the top left corner. Using the lexicographic ordering of A057555 the sequence is:
A(n) = Table(i,j) with (i,j)=(1,1),(1,2),(2,1),(1,3),(2,2),(3,1)...
+3 | 8 16 32 64 128 256 512 ...
----|-------------------------------------------
1 | 11 19 35 67 131 259 515
3 | 27 51 99 195 387 771 1539
7 | 59 115 227 451 899 1795 3587
15 | 123 243 483 963 1923 3843 7683
31 | 251 499 995 1987 3971 7939 15875
63 | 507 1011 2019 4035 8067 16131 32259
127 | 1019 2035 4067 8131 16259 32515 65027
...
All of these numbers have the following property: let m be a member of A(n); if a sequence B(n) = all i such that i XOR (m - 1) = i - (m - 1), then the differences between successive members of B(n) is an alternating series of 1's and 3's with the last difference in the pattern m. The number of alternating 1's and 3's in the pattern is 2^(j+1) - 1, where j is the column index.
As an example consider A(1) which is 11, the sequence B(n) where i XOR 10 = i - 10 starts as 10, 11, 14, 15, 26, 27, 30, 31, 42, ... (A214864) with successive differences of 1, 3, 1, 11.
Main diagonal is A191341, the largest k such that k-1 and k+1 in binary representation have the same number of 1's and 0's

Crossrefs

Cf. A057555(lexicographic ordering), A214864(example), A224195.
Rows: A062729(i=1), A147595(2 n>=5), A164285(3 n>=3).
Cols: A168616(j=1 n>=4).
Diagonal: A191341.

Programs

  • Magma
    //program generates values in a table form,row labels of 2^i -1
    for i:=1 to 10 do
        m:=2^i - 1;
        m, [ m*2^n +1 : n in [1..10]];
    end for;
    //program generates sequence in lexicographic ordering of A057555, read
    //along antidiagonals from top. Primes in the sequence are marked with *.
    for i:=2 to 18 do
        for j:=1 to i-1 do
           m:=2^j -1;
           k:=m*2^(2+i-j) + 3;
           if IsPrime(k) then k, "*";
              else k;
           end if;;
        end for;
    end for;

Formula

a(n) = 2^(A057555(2*n - 1))*2^(A057555(2*n) + 2) + 3 for n>=1.

A284203 Number of twin prime (A001097) divisors of n.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Mar 22 2017

Keywords

Examples

			--------------------------------------------
| n | divisors of n | twin prime    | a(n) |
|   |               | divisors of n |      |
|------------------------------------------
| 1 | {1}           |      {-}      |  0   |
| 2 | {1, 2}        |      {-}      |  0   |
| 3 | {1, 3}        |      {3}      |  1   |
| 4 | {1, 2, 4}     |      {-}      |  0   |
| 5 | {1, 5}        |      {5}      |  1   |
| 6 | {1, 2, 3, 6}  |      {3}      |  1   |
| 7 | {1, 7}        |      {7}      |  1   |
| 8 | {1, 2, 4, 8}  |      {-}      |  0   |
| 9 | {1, 3, 9}     |      {3}      |  1   |
--------------------------------------------
		

Crossrefs

Cf. A048599 (positions of records).

Programs

  • Mathematica
    nmax = 110; Rest[CoefficientList[Series[Sum[Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x]]
    Table[Length[Select[Divisors[n], PrimeQ[#] && (PrimeQ[# - 2] || PrimeQ[# + 2]) &]], {n, 110}]
  • PARI
    concat([0, 0],Vec(sum(k=1, 110, (isprime(k) && (isprime(k - 2) || isprime(k + 2)))* x^k/(1 - x^k)) + O(x^111))) \\ Indranil Ghosh, Mar 22 2017
    
  • PARI
    a(n) = sumdiv(n, d, isprime(d) && (isprime(d-2) || isprime(d+2))); \\ Amiram Eldar, Jun 03 2024
    
  • Python
    from sympy import isprime, divisors
    print([len([i for i in divisors(n) if isprime(i) and (isprime(i - 2) or isprime(i + 2))]) for n in range(1, 111)]) # Indranil Ghosh, Mar 22 2017

Formula

G.f.: Sum_{k>=1} x^A001097(k)/(1 - x^A001097(k)).
a(A062729(n)) = 0. - Ilya Gutkovskiy, Apr 02 2017
From Amiram Eldar, Jun 03 2024: (Start)
a(A048599(n)) = n.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A065421 - 1/5 = 1.7021605... . (End)
Additive with a(p^e) = 1 if p is in A001097, and 0 otherwise. - Amiram Eldar, May 15 2025
a(A037074(n)) = 2. - Michel Marcus, May 15 2025

A284599 Sum of twin prime (A001097) divisors of n.

Original entry on oeis.org

0, 0, 3, 0, 5, 3, 7, 0, 3, 5, 11, 3, 13, 7, 8, 0, 17, 3, 19, 5, 10, 11, 0, 3, 5, 13, 3, 7, 29, 8, 31, 0, 14, 17, 12, 3, 0, 19, 16, 5, 41, 10, 43, 11, 8, 0, 0, 3, 7, 5, 20, 13, 0, 3, 16, 7, 22, 29, 59, 8, 61, 31, 10, 0, 18, 14, 0, 17, 3, 12, 71, 3, 73, 0, 8, 19, 18, 16, 0, 5, 3, 41, 0, 10, 22, 43, 32, 11, 0, 8
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 30 2017

Keywords

Examples

			a(15) = 8 because 15 has 4 divisors {1, 3, 5, 15} among which 2 are twin primes {3, 5} therefore 3 + 5 = 8.
		

Crossrefs

Programs

  • Maple
    N:= 200: # to get a(1)..a(N)
    P:= select(isprime, {seq(i,i=3..N+2)}):
    TP:= P intersect map(`-`,P,2):
    TP:= TP union map(`+`,TP,2):
    V:= Vector(N):
    for p in TP do
      pm:= [seq(i,i=p..N,p)];
      V[pm]:= map(`+`,V[pm],p);
    od:
    convert(V,list); # Robert Israel, Mar 30 2017
  • Mathematica
    Table[Total[Select[Divisors[n], PrimeQ[#1] && (PrimeQ[#1 - 2] || PrimeQ[#1 + 2]) &]], {n, 80}]
  • PARI
    a(n) = sumdiv(n, d, d*(isprime(d) && (isprime(d-2) || isprime(d+2)))); \\ Michel Marcus, Apr 02 2017
  • Python
    from sympy import divisors, isprime
    def a(n): return sum([i for i in divisors(n) if isprime(i) and (isprime(i - 2) or isprime(i + 2))])
    print([a(n) for n in range(1, 91)]) # Indranil Ghosh, Mar 30 2017
    

Formula

G.f.: Sum_{k>=1} A001097(k)*x^A001097(k)/(1 - x^A001097(k)).
a(n) = Sum_{d|n, d twin prime} d.
a(A062729(n)) = 0.
a(A001097(n)) = A001097(n).
Additive with a(p^e) = p if p is in A001097, and 0 otherwise. - Amiram Eldar, May 15 2025

A062506 n divisible by at least one twin prime (A001097).

Original entry on oeis.org

3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87
Offset: 1

Views

Author

Leroy Quet, Jul 09 2001

Keywords

Comments

Complement of A062729.

Examples

			36 is included because 36 is divisible by 3 and 3+2 is a prime.
		

Programs

  • PARI
    isok(n) = {my(f = factor(n)); for (i=1, #f~, p = f[i, 1]; if (isprime(p-2) || isprime(p+2), return (1));); return (0);} \\ Michel Marcus, May 20 2014

Extensions

Offset changed to 1 by Michel Marcus, May 20 2014
Showing 1-4 of 4 results.