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: Yigit Oktar

Yigit Oktar's wiki page.

Yigit Oktar has authored 6 sequences.

A382279 a(n) is the integer whose bits encode subset sums of the first n arithmetic numbers (A003601).

Original entry on oeis.org

1, 3, 27, 891, 57339, 7340027, 15032385531, 123145302310907, 2017612633061982203, 66113130760175032991739, 8665580274997661924293869563, 4543259751217974174964184288067579, 4763953136893138488487244504044754960379, 9990733848941719167408001786146465954679226363
Offset: 0

Author

Yigit Oktar, Mar 20 2025

Keywords

Comments

Bit position 0 (which is sum 0) is the least significant bit of a(n).
The resulting binary string is palindromic for all n. A subset sum of zero marks one end of the binary string, while the sum of the first n arithmetic numbers marks the other end. This is true for all sets of positive integers. See A368491 for the encoding applied to the first n primes.

Examples

			For n = 0, there are no terms from which to calculate a subset sum. An empty array gives zero as the only possible sum. This is designated by the binary string 1.
For n = 2, sums of 0, 1, 3, 4 are possible, yielding a binary string of 11011, which has a value of 27 in base 10. The impossibility of the sum 2 is indicated by 0 in the binary string.
For n = 3, the arithmetic numbers are 1,3,5 and their subset sums 0, 1, 3, 4, 5, 6, 8, 9 are the positions of 1 bits in a(3) = 891.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; uses numtheory; local k; for k from 1+
         `if`(n=1, 0, b(n-1)) while irem(sigma(k), tau(k))>0 do od; k
        end:
    a:= proc(n) option remember; `if`(n=0, 1,
          Bits[Or](a(n-1), a(n-1)*2^b(n)))
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Mar 20 2025
  • Python
    from sympy import divisors, divisor_count
    n = 20
    tn  = [a for a in range(1, n) if not sum(divisors(a)) % divisor_count(a)] #code from A003601
    res = 1
    a = []
    a.append(res)
    for v in tn:
      res = (res | (res << v))
      a.append(res)
    print(a)

Formula

a(n) = a(n-1) OR a(n-1)*2^A003601(n) for n>=1, a(0) = 1.

A368491 a(n) is the integer whose bits designate the possible subset sums of the first n prime numbers.

Original entry on oeis.org

1, 5, 45, 1453, 186285, 381681581, 3126736191405, 409827566090715053, 214867674970568857223085, 1802440697199513680253124870061, 967677980931418755473971539884090851245, 2078072640579877586820864371518464918573279084461, 285608128960093974754528418755948821932657172723113570336685
Offset: 0

Author

Yigit Oktar, Dec 27 2023

Keywords

Comments

Bit position 0 (which is sum 0) is the least significant bit of a(n).
The resulting binary string is palindromic for all n. A subset sum of zero marks one end of the binary string, while the sum of all n primes marks the other end. Therefore, starting from no primes and adding some and starting from all primes and omitting some correspond to the same pattern. (This is so for any values, not just primes.)
It is observed that for an array of primes, for large values of n, the binary string starts with a certain pattern and ends with the reverse of this certain pattern and consists of all ones in the middle area.

Examples

			For n = 0, there are no terms from which to calculate a subset sum. An empty array gives zero as the only possible sum. This is designated by the binary string 1 which has a value of 1 in base 10.
For n = 2, sums of 0,2,3,5 are possible, yielding a binary string of 101101, which has a value of 45 in base 10. The impossibility of sums 1 and 4 is indicated by 0's in the binary string.
For n = 3, the primes are 2,3,5 and their subset sums 0, 2, 3, 5, 7, 8, 10 are the positions of 1 bits in a(3) = 1453,
       10   8 7   5   3 2   0   bit positions
a(n) =  1 0 1 1 0 1 0 1 1 0 1   binary
		

Crossrefs

Cf. A000040, A082548 (number of sums), A007504 (see formula).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1,
          Bits[Or](a(n-1), a(n-1)*2^ithprime(n)))
        end:
    seq(a(n), n=0..15);  # Alois P. Heinz, Mar 20 2025
  • Python
    from primesieve import *
    n = 20
    ps = generate_n_primes(n)
    res = 1
    a = []
    a.append(res)
    for v in ps:
      res = (res | (res << v))
      a.append(res)
    print(a)

Formula

a(n) = a(n-1) BITOR a(n-1)*2^prime(n).
a(n) = 91*2^(A007504(n)-6) - 83 for n > 3.

A350519 a(n) = A(n,n) where A(1,n) = A(n,1) = prime(n+1) and A(m,n) = A(m-1,n) + A(m,n-1) + A(m-1,n-1) for m > 1 and n > 1.

Original entry on oeis.org

3, 13, 63, 325, 1719, 9237, 50199, 275149, 1518263, 8422961, 46935819, 262512929, 1472854451, 8285893713, 46723439019, 264009961733, 1494486641911, 8473508472009, 48112827862527, 273541139290857, 1557023508876891, 8872219429659729, 50605041681538595, 288897992799897481
Offset: 1

Author

Yigit Oktar, Jan 02 2022

Keywords

Comments

Replacing prime(n+1) by other functions f(n) we can get many other sequences. For example, with f(n) = 1 we get A001850.

Examples

			The two-dimensional recurrence A(m,n) can be depicted in matrix form as
   3   5   7   11   13    17    19 ...
   5  13  25   43   67    97   133 ...
   7  25  63  131  241   405   635 ...
  11  43 131  325  697  1343  2383 ...
  13  67 241  697 1719  3759  7485 ...
  17  97 405 1343 3759  9237 20481 ...
  19 133 635 2383 7485 20481 50199 ...
  ...
and then a(n) is the main diagonal of this matrix, A(n,n).
		

Crossrefs

Cf. A000040, A001850, A002002, A050151, A344576 (see comments).

Programs

  • MATLAB
    clear all
    close all
    sz = 14
    f = zeros(sz,sz);
    pp = primes(50);
    f(1,:) = pp(2:end);
    f(:,1) = pp(2:end);
    for m=2:sz
        for  n=2:sz
            f(m,n) = f(m-1,n-1)+f(m,n-1)+f(m-1,n);
        end
    end
    an = []
    for n=1:sz
        an = [an f(n,n)];
    end
    S = sprintf('%i,',an);
    S = S(1:end-1)
  • Mathematica
    f[1,1]=3;f[m_,1]:=Prime[m+1];f[1,n_]:=Prime[n+1];f[m_,n_]:=f[m,n]=f[m-1,n]+f[m,n-1]+f[m-1,n-1];Table[f[n,n],{n,25}] (* Giorgos Kalogeropoulos, Jan 03 2022 *)

A349723 Atomic number corresponding to the element that is the first of the two middle elements in the n-th row of the periodic table of elements.

Original entry on oeis.org

1, 6, 14, 27, 45, 70, 102, 143, 193, 254, 326, 411, 509, 622, 750, 895, 1057, 1238, 1438, 1659, 1901, 2166, 2454, 2767, 3105, 3470, 3862, 4283, 4733, 5214, 5726, 6271, 6849, 7462, 8110, 8795, 9517, 10278, 11078, 11919, 12801, 13726, 14694, 15707
Offset: 1

Author

Yigit Oktar, Dec 31 2021

Keywords

Comments

Elements corresponding to the initial sequence terms are hydrogen, carbon, silicon, cobalt, rhodium, ytterbium, and nobelium. However, there may not be a physical realization for higher terms.

Examples

			For n=1, hydrogen (with atomic number 1) is the first element of two middle elements in the 1st row of periodic table.
For n=2, carbon (with atomic number 6) is the first element of the two middle elements in the 2nd row of periodic table.
In general, the n-th number is the addition of the atomic number of the first lower noble element plus half the number of elements in the current row of the periodic table.
		

Crossrefs

Formula

a(n) = A018227(n-1) + A093907(n)/2 for n > 1.
a(n) = (A018227(n) + A018227(n-1))/2 for n > 1.
a(n) = (4*n^3 + 18*n^2 + 32*n + 3*(-1)^n - 27)/24.
G.f.: x*(1 + 3*x - 2*x^2 - x^3 + x^4)/((1 - x)^4*(1 + x)). - Stefano Spezia, Dec 31 2021

A325958 Sum of the corners of a 2n+1 X 2n+1 square spiral.

Original entry on oeis.org

24, 76, 160, 276, 424, 604, 816, 1060, 1336, 1644, 1984, 2356, 2760, 3196, 3664, 4164, 4696, 5260, 5856, 6484, 7144, 7836, 8560, 9316, 10104, 10924, 11776, 12660, 13576, 14524, 15504, 16516, 17560, 18636, 19744, 20884, 22056, 23260, 24496, 25764, 27064, 28396
Offset: 1

Author

Yigit Oktar, Sep 10 2019

Keywords

Comments

The 3 X 3 and 5 X 5 spirals are
.
7---8---9
|
6 1---2
| |
5---4---3
.
with corners 7 + 9 + 5 + 3 = 24
and
.
21--22--23--24--25
|
20 7---8---9--10
| | |
19 6 1---2 11
| | | |
18 5---4---3 12
| |
17--16--15--14--13
.
with corners 21 + 25 + 17 + 13 = 76.
An issue arises when considering a 1 X 1 spiral. For ease, a 1 X 1 spiral happens to have no corners so the corresponding value might be considered as undefined (namely, undefined for n = 0).
However, from a theoretical perspective if n is allowed to be 0, meaning that a 1 X 1 spiral can have corners, the formulas below that include A114254 might need reconsideration. With the current formula a(n) = 16*n^2 + 4*n + 4, a(0) = 4, meaning that a 1 X 1 spiral (with value 1) has 4 corners with value 1, giving sum 4. This might pave the way to a discussion, considered parallel with A114254. With the given equations, a 1 X 1 spiral happens to have a corner sum of 4. However, a 1 X 1 spiral has a diagonal sum of 1, from A114254. This seems as to be a contradiction; namely, the first term of A114254 should at least be 4 in this case, as corners constitute a subset of diagonal elements.

Examples

			For n=1 (our first value) namely for a 3 X 3 spiral, we get a(1) = 24.
For n=2, for a 5 X 5 spiral, we get a(2) = 76.
		

Crossrefs

Cf. A114254.

Programs

  • Mathematica
    Table[ 16n^2+4n+4, {n, 42}] (* Metin Sariyar, Sep 14 2019 *)
  • PARI
    a(n) = 16*n^2 + 4*n + 4;
    
  • PARI
    Vec(4*x*(6 + x + x^2) / (1 - x)^3 + O(x^40)) \\ Colin Barker, Sep 10 2019

Formula

a(n) = A114254(n) - A114254(n-1).
a(n) = 16*n^2 + 4*n + 4.
From Colin Barker, Sep 10 2019: (Start)
G.f.: 4*x*(6 + x + x^2) / (1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>3.
(End)
E.g.f.: -4 + 4*exp(x)*(1 + 5*x + 4*x^2). - Stefano Spezia, Sep 11 2019

A306656 Number of ways to fill a 3D matrix with n distinct values.

Original entry on oeis.org

1, 1, 6, 18, 144, 360, 6480, 15120, 403200, 2177280, 32659200, 119750400, 8622028800, 18681062400, 784604620800, 11769069312000, 313841848320000, 1067062284288000, 115242726703104000, 364935301226496000, 43792236147179520000, 459818479545384960000
Offset: 0

Author

Yigit Oktar, Mar 03 2019

Keywords

Comments

This sequence is a generalization of A323295 to the 3D case. Usually, in multidimensional data related applications (i.e., images, MRI), data is vectorized and then processed. However, because of vectorization, the spatial information in the data is lost. This reverse mapping shows the possible number of spatial states the original data could have been in.

Examples

			For n = 6, a(6) = 6480, A007425(6) = 9 namely there are 9 ways to arrange 6 voxels into a 3D matrix: [1,1,6], [1,6,1], [6,1,1], [2,3,1], [3,2,1], [2,1,3], [3,1,2], [1,2,3], [1,3,2]. Then there are 6! ways to fill it with the numbers. 9*6! = 6480.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= n-> `if`(n=0, 1, add(tau(d), d=divisors(n))*n!):
    seq(a(n), n=0..23);  # Alois P. Heinz, Mar 03 2019
  • Mathematica
    A007425[n_] := DivisorSigma[0, #]& /@ Divisors[n] // Total;
    a[n_] := If[n == 0, 1, A007425[n]*n!];
    Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Feb 02 2025 *)

Formula

a(n) = A007425(n) * n! for n > 0, a(0) = 1.

Extensions

More terms from Alois P. Heinz, Mar 03 2019