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: Aidan Clarke

Aidan Clarke's wiki page.

Aidan Clarke has authored 9 sequences.

A358431 a(0) = 1; a(n+1) = 1 if a(n) > n, otherwise a(n+1) = a(n) + a(a(n)).

Original entry on oeis.org

1, 1, 2, 4, 1, 2, 4, 5, 7, 12, 1, 2, 4, 5, 7, 12, 16, 32, 1, 2, 4, 5, 7, 12, 16, 32, 1, 2, 4, 5, 7, 12, 16, 32, 48, 1, 2, 4, 5, 7, 12, 16, 32, 48, 1, 2, 4, 5, 7, 12, 16, 32, 48, 55, 1, 2, 4, 5, 7, 12, 16, 32, 48, 55, 57, 62, 110, 1, 2, 4, 5, 7, 12, 16, 32, 48, 55, 57, 62, 110
Offset: 0

Author

Aidan Clarke, Nov 15 2022

Keywords

Crossrefs

Cf. A062039.

Programs

  • Mathematica
    a[0] = 1; a[n_] := a[n] = If[a[n - 1] > n - 1, 1, a[n - 1] + a[a[n - 1]]]; Array[a, 80, 0] (* Amiram Eldar, Dec 06 2022 *)
  • Python
    from functools import cache
    @cache
    def a(n): return 1 if n==0 else (1 if a(n-1) > n-1 else a(n-1) + a(a(n-1)))
    print([a(n) for n in range(76)]) # Michael S. Branicky, Nov 15 2022

A356675 Lexicographically earliest infinite sequence satisfying a(1) > -1 and a(n-1) = A075826(a(n)).

Original entry on oeis.org

1, 5, 9, 16, 27, 38, 48, 58, 66, 76, 87, 98, 117, 136, 155, 177, 198, 215, 235, 254, 275, 295, 310, 333, 350, 372, 394, 411, 433, 452, 474, 495, 514, 535, 555, 576, 598, 615, 635, 650, 669, 689, 705, 728, 749, 773, 795, 810, 833, 850, 872, 894, 913, 934, 950, 973, 994, 1013, 1034, 1050, 1071, 1093
Offset: 1

Author

Aidan Clarke, Aug 22 2022

Keywords

Comments

There is at least one infinite sequence that satisfies the parameters of the sequence, because it is always true that A075826(k) < k for any k. (For the statement to be false, the number of letters must be less than or equal to 0.)
All known values in this sequence are guaranteed to be in any infinite sequence which can be produced, since iterating A075826(k) where the starting value of k is any number greater than 11126 converges at 6890 or larger. This proves any infinite sequence must contain 6890 and all values returned by iterating A075826 down to 0.

Examples

			A075826 yields the number of letters in US English spelling of each number subtracted from the number's value. For example, A075826(5) yields 1, because 5 - 4 (F-I-V-E) is 1. Our formula reveals that if 5 is in our sequence, it must come immediately after 1, which it does. However, 4, which must come immediately after 0, is not in our sequence, which we can prove because there exists no number k such that A075826(k) = 4. Each number less than the largest known value in this sequence produces a finite sequence unless it is in this sequence, because some number eventually is a dead end like 4.
		

Crossrefs

Programs

  • PARI
    f(k) = k - A005589(k);
    listd(nn) = {nn *= 2; my(vs = vector(nn)); my(list = List()); my(m=1, lbound = 0); listput(list, m); while (m < nn, if (vs[m] == 0, vs[m] = Vec(select(x->(x==m), vector(100, k, f(k+m-1)), 1)); if (#vs[m], vs[m] = apply(x->(x+m-1), vs[m]))); my(ok = 1, vc = vs[m]); if (! #vc, ok = 0, vc = select(x->(x>lbound), vc); if (! #vc, ok = 0);); if (!ok, lbound = list[#list]; listpop(list); if (! #list, return()); m = list[#list];, lbound = 0; m = vc[1]; listput(list, m););); Vec(select(x->(x<=nn/2), list));} \\ Michel Marcus, Aug 31 2022

Formula

a(n-1) = A075826(a(n)).

A338174 The largest value that integer n is connected to in a web where every integer n has n connections, each integer is connected to the lowest values possible, and new values are added in phases.

Original entry on oeis.org

2, 3, 5, 7, 10, 11, 13, 16, 20, 25, 21, 22, 23, 24, 25, 26, 28, 31, 35, 40, 46, 54, 64, 76, 90, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 80, 82, 84, 86, 88, 90, 92, 96, 102, 110, 120, 132, 146
Offset: 1

Author

Aidan Clarke, Nov 18 2020

Keywords

Comments

The concept of this sequence is based on a web where every possible connection in the web is made with the numbers written so far, and then new numbers are added for every connection that needs to be made.

Examples

			Start with a map of nothing but 1.
   1 has 0 connections.
So we add 2 and connect it.
   1 has 1 connection (2)
   2 has 1 connection (1)
Now we need one more number to connect with 2, so we add 3.
   2 has 2 connections (1,3)
   3 has 1 connection (2)
Now because 3 needs two more numbers, we add 4 and 5 at once, and make as many connections as possible.
   3 has 3 connections (2,4,5)
   4 has 2 connections (3,5)
   5 has 2 connections (3,4)
We need five more numbers because 4 lacks two connections, and 5 lacks three connections, so we add 6,7,8,9,10.
   4 has 4 connections (3,5,6,7)
   5 has 5 connections (3,4,8,9,10)
   6 has 5 connections (4,7,8,9,10)
   7 has 5 connections (4,6,8,9,10)
   8 has 5 connections (5,6,7,9,10)
   9 has 5 connections (5,6,7,8,10)
   10 has 5 connections (5,6,7,8,9)
This continues indefinitely.
		

A337804 Lexicographically earliest triangle of nonnegative integers read by rows such that for each pair (x,y) != (0,0), there is at most one pair (n,k) such that T(n,k) = T(n+x,k+y).

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 0, 3, 4, 0, 3, 5, 2, 6, 3, 2, 7, 8, 5, 1, 9, 1, 0, 9, 10, 11, 7, 2, 6, 4, 12, 13, 14, 15, 0, 8, 9, 11, 16, 17, 18, 19, 20, 6, 5, 5, 15, 21, 22, 23, 24, 25, 21, 3, 10, 8, 1, 3, 26, 27, 28, 29, 7, 16, 1, 4, 2, 19, 30, 31, 32, 33, 34, 35, 30, 2, 12, 11
Offset: 1

Author

Aidan Clarke, Sep 22 2020

Keywords

Comments

Each value is determined by placing the least possible nonnegative integer that will abide by the rules of the sequence.

Examples

			Triangle begins:
0;
0, 0;
1, 2, 1;
0, 3, 4, 0;
3, 5, 2, 6, 3;
2, 7, 8, 5, 1, 9;
...
		

Crossrefs

Cf. A337226 (linear version).

Programs

  • PARI
    T(n)={my(v=vector(n), S=Set(), L=List());
      for(n=1, #v, v[n]=vector(n); for(k=1, n, my(i=1);
        while(i<=#L, my(P=Set([[n-p[1], k-p[2]] | p<-L[i]])); if(!#setintersect(P,S), S = setunion(S,P); break); i++);
        if(i>#L, listput(L, []));
        L[i] = concat(L[i], [[n,k]]);
        v[n][k] = i-1 )); v
    }
    concat(T(12)) \\ Andrew Howroyd, Sep 24 2020
    
  • PARI
    See Links section.

Extensions

Terms a(46) and beyond from Andrew Howroyd, Sep 24 2020

A334146 Numbers with at least two prime factors greater than 3 counted with multiplicity.

Original entry on oeis.org

25, 35, 49, 50, 55, 65, 70, 75, 77, 85, 91, 95, 98, 100, 105, 110, 115, 119, 121, 125, 130, 133, 140, 143, 145, 147, 150, 154, 155, 161, 165, 169, 170, 175, 182, 185, 187, 190, 195, 196, 200, 203, 205, 209, 210, 215, 217, 220, 221, 225, 230, 231, 235, 238, 242
Offset: 1

Author

Aidan Clarke, Apr 16 2020

Keywords

Examples

			25 = 5*5
35 = 5*7
49 = 7*7
50 = (2)*5*5
55 = 5*11
65 = 5*13
70 = (2)*5*7
75 = (3)*5*5
		

Crossrefs

Cf. A093641.

Programs

  • Mathematica
    Select[Range[250], CompositeQ[# / 2^IntegerExponent[#, 2] / 3^IntegerExponent[#, 3]] &] (* Amiram Eldar, May 01 2020 *)
  • PARI
    is(n)=n>>=valuation(n,2);n/=3^valuation(n,3);n>1 && !isprime(n) \\ Charles R Greathouse IV, Apr 16 2020

Formula

a(n) ~ n. - Charles R Greathouse IV, Apr 16 2020

A333614 Lexicographically first sequence of nonnegative integers such that no two terms share all but one digit in common, nor does interchanging any two adjacent digits in any term change it into another term of the sequence.

Original entry on oeis.org

0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 102, 110, 121, 134, 145, 153, 167, 178, 186, 201, 212, 220, 235, 243, 254, 268, 276, 287, 304, 313, 326, 330, 341, 352, 365, 379, 398, 403, 414, 425, 432, 440, 451, 469, 497, 506, 515, 523, 531, 542, 550, 564, 589, 605, 616, 624, 637, 648, 659
Offset: 1

Author

Aidan Clarke, Mar 28 2020

Keywords

Comments

The rules of this sequence are designed to decrease the likelihood of confusing any two numbers in the sequence. This would be ideal, for example, in the case of generating account numbers.

Examples

			a(1) = 0 because it is the smallest nonnegative integer.
a(2) = 11 because all integers between 1 and 10 only differ from 0 by one digit.
a(3) = 22 because all integers between 12 and 21 only differ from 11 by one digit.
a(11) = 102 because 101 becomes 011 when interchanging the first two adjacent digits.
		

Crossrefs

Cf. A008585 (binary analog).

Programs

  • PARI
    See Links section.

A322523 a(n) is the least nonnegative integer k for which there does not exist i < j with i+j=n and a(i)=a(j)=k.

Original entry on oeis.org

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

Author

Aidan Clarke, Aug 28 2019

Keywords

Comments

If x is an integer that we are checking whether it is an option for a(n), at position n = 3(3^(x+1)-1)/2 there appears to begin a repeating sequence (containing 3^(x+1) terms) of whether it can or cannot be used for a(n) that continues infinitely.
The variant where we drop the condition "i < j" corresponds to A007814. - Rémy Sigrist, Sep 06 2019

Examples

			a(1) = 0.
a(2) = 0.
a(3) = 1 (because a(1) and a(2) both equal 0).
a(5) = 1 (because a(1) and a(4) both equal 0).
a(8) = 2 (because a(1) and a(7) equal 0, and a(3) and a(5) equal 1).
		

Crossrefs

Programs

  • Maple
    for n from 1 to 100 do
      forbid:= {seq(A[i],i= select(i -> A[i]=A[n-i],[$1..(n-1)/2]))};
      if forbid = {} then A[n]:= 0 else A[n]:= min({$0..max(forbid)+1} minus forbid) fi;
    od:
    seq(A[i],i=1..100); # Robert Israel, Sep 06 2019
  • PARI
    least(v, n) = {my(found = []); for (i=1, n, if (i >= n-i, break, if (v[i] == v[n-i], found = Set(concat(found, v[i]))));); if (#found == 0, return(0)); my(m = vecmax(found)); for (i=0, m, if (!vecsearch(found, i), return (i))); return (m+1);}
    lista(nn) = {my(v = vector(nn)); for (n=1, nn, v[n] = least(v, n);); v;} \\ Michel Marcus, Sep 07 2019
    
  • PARI
    a(n) = my(v=valuation(n,3)); n=n/3^v; if(n==2 || n%3==1, v, A215879((n-5)/3)+1+v) \\ Jianing Song, Aug 23 2022; see A215879 for its program
    
  • Python
    def A322523(n):
        c, m = 0, n
        while not (a:=divmod(m,3))[1]:
            c += 1
            m = a[0]
        if m==2 or m%3==1: return c
        m = (m+1)//3-2
        while (a:=divmod(m,3))[1]:
            c += 1
            m = a[0]
        return c+1 # Chai Wah Wu, Oct 15 2022

Formula

a(n) = 0 iff n belongs to A033627. - Rémy Sigrist, Sep 06 2019
From Jianing Song, Aug 23 2022: (Start)
Properties of this sequence:
(1) a(n) = a(n/3) + 1 for n == 0 (mod 3).
Proof is based on induction on n. Obviously a(n) != 0. For 1 <= e <= a(n/3), there exists i+j = n/3, i < j such that a(i) = a(j) = e-1, by induction hypothesis we have a(3*i) = a(3*j) = e, so a(n) != e. a(n) = a(n/3) + 1 is OK. Suppose otherwise that n = i+j, i < j and a(i) = a(j) = a(n/3) + 1 > 0, then i,j == 0 (mod 3), by induction hypothesis we have a(i/3) = a(j/3) = a(n/3), a contradiction.
(2) a(n) = A215879((n-5)/3) + 1 for n == 2 (mod 3) and n > 2.
If A215879((n-5)/3) = t, then n = 3*(Sum_{0<=r<=t-1} d_r*3^r + O(3^(t+1))) + 5, d_r = 1 or 2. Suppose that a(m) = A215879((m-5)/3) + 1 for m == 2 (mod 3) and 2 < n < m.
Obviously a(n) != 0. From (1) we know that a(3^e) = a(2*3^e) = t. For 1 <= e <= t, n - d_e*3^e = 3*(Sum_{0<=r<=t-1, r!=e-1} d_r*3^r + O(3^(t+1))) + 5 = 3*(Sum_{0<=r<=e-2} d_r*3^r + O(3^e)) + 5, so A215879((n-d_e*3^e-5)/3) = e-1. Since 5 <= n - d_e*3^e == 2 (mod 3), by induction hypothesis we have a(n-d_e*3^e) = e = a(d_e*3^e), so a(n) != e.
a(n) = t+1 is OK. Suppose otherwise that n = i+j, i != j and a(i) = a(j) = t+1 > 0, then {i,j} == {0,2} (mod 3) and i,j > 2. Suppose that i == 2 (mod 3), by induction hypothesis A215879((i-5)/3) = t. Write i = 3*(Sum_{0<=r<=t-1} d'_r*3^r + O(3^(t+1))) + 5, 1 <= d'_r <= d_r. If d'_r = d_r for all r, then j = n-i is divisible by 3^(t+2), so a(j) >= t+2, a contradiction. If d'_r != d_r for some r, then j = 3^(r_0+1) + O(3^(r_0+2)) where r_0 is the smallest index such that d'_r != d_r, so a(j) = r_0+1 + a(1+O(3^1)) = r_0+1 <= t, also a contradiction.
Recursive formulas:
a(n) = 0 for n = 2 or n == 1 (mod 3);
a(n) = 1 for n == 5 (mod 9);
a(n) = a(n/3) + 1 for n == 0 (mod 3);
a(n) = a((n+4)/3) + 1 for n == 2 (mod 9) and n > 2;
a(n) = a((n+7)/3) + 1 for n == 8 (mod 9).
Let A_1 = {3}, B_1 = {5}, A_{t+1} = {3*n: n in A_t, B_t}, B_{t+1} = {3*n-7, 3*n-4: n in B_t}, then for t >= 1, {n: a(n) = t} = (Union_{k>=0} {n+k*3^(t+1): n in A_t, B_t}) U {2*3^t}.
General formula: write n = s*3^t, gcd(s,3) = 1, then a(n) = t if s = 2 or s == 1 (mod 3), A215879((s-5)/3) + 1 + t otherwise. (End)

A299790 Positive integers that do not equal any number minus its number of factorizations.

Original entry on oeis.org

3, 9, 15, 21, 26, 29, 34, 35, 38, 39, 43, 45, 50, 51, 54, 57, 62, 69, 74, 86, 87, 90, 98, 101, 103, 107, 110, 111, 114, 118, 123, 124, 134, 135, 137, 142, 146, 151, 152, 155, 158, 161, 163, 170, 173, 174, 179, 186, 188, 189, 191, 194, 197, 206, 214, 218, 220, 221, 227, 229, 230, 231, 237, 239, 242, 244, 246, 248
Offset: 1

Author

Aidan Clarke, Jan 21 2019

Keywords

Crossrefs

Cf. A001055 (number of factorizations).

Programs

  • PARI
    fcnt(n, m) = {local(s); s=0; if(n == 1, s=1, fordiv(n, d, if(d > 1 & d <= m, s=s+fcnt(n/d, d)))); s};
    f(n) = n - fcnt(n, n);
    is(n) = j=1;x=2^(floor(log(n)/log(2))+2);while(jJinyuan Wang, Feb 14 2019

Extensions

More terms from Jinyuan Wang, Feb 14 2019

A317888 The minimum value in the central cell of an n-dimensional cube, three cells wide in each dimension, such that each cell is the product of its adjacent cells, each cell is a whole number, and no two cells have the same value.

Original entry on oeis.org

6, 120, 362880, 355687428096000, 8683317618811886495518194401280000000, 8247650592082470666723170306785496252186258551345437492922123134388955774976000000000000000
Offset: 1

Author

Aidan Clarke, Aug 10 2018

Keywords

Comments

We can prove that the corner cells are filled with values from 2 to 2^n+1, because in order to prove that none of the corner cells have to skip a value so as not to repeat a value within any of the other cells, we must prove that the non-corner cells all have values greater than 2^n+1 in at least one arrangement of corner cell values. 2(2^n-n+2) can describe the lowest value of cells in between two corner cells in every dimension from one to infinity, excluding the third dimension, because in the ideal arrangement of the three-dimensional grid, 12 must appear between 3 and 4, while the formula returns the value 14. Regardless, 12 is still greater than 2^n+1, which is 9 in three dimensions. Every value for 2(2^n-n+2) is greater than 2^n+1 as can clearly be observed from a graph. The formula 2(2^n-n+2) was derived from the fact that the smallest non-corner values appear next to 2 in every dimension except the third, and next to 3 in the first three dimensions. So with the exclusion of the third dimension due to its limited number of corner cells, these values must be equal to the product of 2 and the lowest number that is paired with 2. The lowest number that is paired with 2 in an ideal arrangement of values is always equal to one less than the number of dimensions, n-1, subtracted from the highest corner value, 2^n+1, thus resulting in 2^n+1-(n-1), or in its simplified form, 2^n-n+2. When multiplying this by two, we receive the lowest non-corner value possible in every dimension except the third.

Examples

			One arrangement for n=2 is:
   2   10   5
   8  120  15
   4   12   3
a(2) = 120 because this is the minimum possible value for the central cell.
		

Crossrefs

Formula

a(n) = (2^n+1)!.
a(n) = A000142(A000051(n)). - Michel Marcus, Aug 11 2018