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-3 of 3 results.

A117384 Positive integers, each occurring twice in the sequence, such that a(n) = a(k) when n+k = 4*a(n), starting with a(1)=1 and filling the next vacant position with the smallest unused number.

Original entry on oeis.org

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

Views

Author

Paul D. Hanna, Mar 11 2006

Keywords

Comments

Positions where n occurs are A001614(n) and 4*n-A001614(n), where A001614 is the Connell sequence: 1 odd, 2 even, 3 odd, ...
From Paolo Xausa, Aug 27 2021: (Start)
Terms can be arranged in an irregular triangle T(r,c) read by rows in which row r is a permutation P of the integers in the interval [s, s+rlen-1], where s = 1+(r-1)*(r-2)/2, rlen = 2*r-1 and r >= 1 (see example).
P is the alternating (first term > second term < third term > fourth term ...) permutation m -> 1, 1 -> 2, m+1 -> 3, 2 -> 4, m+2 -> 5, 3 -> 6, ..., rlen -> rlen, where m = ceiling(rlen/2).
The triangle has the following properties.
Row lengths are the positive odd numbers.
First column is A000124.
Terms in column c (where c >= 1) are of the form k*(k+1)/2+ceiling(c/2), for integers k >= floor((c-1)/2), each even column being equal to the column preceding it.
Row records (the positive terms of A000217) are in the right border.
Indices of row records are the positive terms of A000290.
Each row r contains r terms that are duplicated in the next row.
In each row, the sum of terms which are not already listed in the sequence gives the positive terms of A006003.
Row sums give A063488.
For rows r >= 2, row product is A057003(r)*A057003(r-1). (End)

Examples

			9 first appears at position: A001614(9) = 14;
9 next appears at position: 4*9 - A001614(9) = 22.
From _Paolo Xausa_, Aug 27 2021: (Start)
Written as an irregular triangle T(r,c) the sequence begins:
  r\c  1   2   3   4   5   6   7   8   9  10  11  12  13
  1:   1;
  2:   2,  1,  3;
  3:   4,  2,  5,  3,  6;
  4:   7,  4,  8,  5,  9,  6, 10;
  5:  11,  7, 12,  8, 13,  9, 14, 10, 15;
  6:  16, 11, 17, 12, 18, 13, 19, 14, 20, 15, 21;
  7:  22, 16, 23, 17, 24, 18, 25, 19, 26, 20, 27, 21, 28;
  ...
The triangle can be arranged as shown below so that, in every row, each odd position term is equal to the term immediately below it.
               1
            2  1  3
         4  2  5  3  6
      7  4  8  5  9  6 10
  11  7 12  8 13  9 14 10 15
             ...
(End)
		

Crossrefs

Cf. A117385 (a(5*a(n)-n)=a(n)), A117386 (a(6*a(n)-n)=a(n)).
Cf. A001614 (Connell sequence).

Programs

  • Mathematica
    nterms=64;a=ConstantArray[0,nterms];For[n=1;t=1,n<=nterms,n++,If[a[[n]]==0,a[[n]]=t;If[(d=4t-n)<=nterms,a[[d]]=a[[n]]];t++]]; a (* Paolo Xausa, Aug 27 2021 *)
    (* Second program, triangle rows *)
    nrows = 8;Table[rlen=2r-1;Permute[Range[s=1+(r-1)(r-2)/2,s+rlen-1],Join[Range[2,rlen,2],Range[1,rlen,2]]],{r,nrows}] (* Paolo Xausa, Aug 27 2021 *)
  • PARI
    {a(n)=local(A=vector(n),m=1); for(k=1,n,if(A[k]==0,A[k]=m;if(4*m-k<=#A,A[4*m-k]=m);m+=1));A[n]}
    
  • PARI
    T(r,c) = my(k = r-1-((c+1) % 2)); k*(k+1)/2+ceil(c/2);
    tabf(nn) = {for (r=1, nn, for(c = 1, 2*r-1, print1(T(r,c), ", ");); print;);} \\ Michel Marcus, Sep 09 2021

Formula

a(4*a(n)-n) = a(n).
Lim_{n->infinity} a(n)/n = 1/2.
Lim_{n->infinity} (a(n+1)-a(n))/sqrt(n) = 1.
a( A001614(n) ) = n; a( 4n - A001614(n) ) = n.
T(r,c) = k*(k+1)/2+ceiling(c/2), where k = r-1-((c+1) mod 2), r >= 1 and c >= 1. - Paolo Xausa, Sep 09 2021

A117386 Positive integers, each occurring twice in the sequence, such that a(n) = a(k) when n+k = 6*a(n), starting with a(1)=1 and filling the next vacant position with the smallest unused number.

Original entry on oeis.org

1, 2, 3, 4, 1, 5, 6, 7, 8, 2, 9, 10, 11, 12, 3, 13, 14, 15, 16, 4, 17, 18, 19, 5, 20, 21, 22, 23, 6, 24, 25, 26, 27, 7, 28, 29, 30, 31, 8, 32, 33, 34, 9, 35, 36, 37, 38, 10, 39, 40, 41, 42, 11, 43, 44, 45, 46, 12, 47, 48, 49, 13, 50, 51, 52, 53, 14, 54, 55, 56, 57, 15, 58, 59, 60, 61
Offset: 1

Views

Author

Paul D. Hanna, Mar 11 2006

Keywords

Crossrefs

Cf. A117384 (a(4*a(n)-n)=a(n)), A117385 (a(5*a(n)-n)=a(n)).

Programs

  • PARI
    {a(n)=local(A=vector(n),m=1); for(k=1,n,if(A[k]==0,A[k]=m;if(6*m-k<=#A,A[6*m-k]=m);m+=1));A[n]}

Formula

a(6*a(n)-n) = a(n). Conjecture: Lim_inf a(n)/n = (3-sqrt(3))/6; Lim_sup a(n)/n = (3+sqrt(3))/6.

A306353 Number of composites among the first n composite numbers whose least prime factor p is that of the n-th composite number.

Original entry on oeis.org

1, 2, 3, 1, 4, 5, 6, 2, 7, 8, 9, 3, 10, 11, 1, 12, 4, 13, 14, 15, 5, 16, 2, 17, 18, 6, 19, 20, 21, 7, 22, 23, 1, 24, 8, 25, 26, 3, 27, 9, 28, 29, 30, 10, 31, 4, 32, 33, 11, 34, 35, 36, 12, 37, 2, 38, 39, 13, 40, 41, 5, 42, 14, 43, 44, 3, 45, 15, 46, 6, 47, 48, 16, 49, 50, 51, 17, 52, 53, 54, 18, 55, 56, 7
Offset: 1

Views

Author

Jamie Morken and Vincenzo Librandi, Feb 09 2019

Keywords

Comments

Composites with least prime factor p are on that row of A083140 which begins with p
Sequence with similar values: A122005.
Sequence written as a jagged array A with new row when a(n) > a(n+1):
1, 2, 3,
1, 4, 5, 6,
2, 7, 8, 9,
3, 10, 11,
1, 12,
4, 13, 14, 15,
5, 16,
2, 17, 18,
6, 19, 20, 21,
7, 22, 23,
1, 24,
8, 25, 26,
3, 27,
9, 28, 29, 30.
A153196 is the list B of the first values in successive rows with length 4.
B is given by the formula for A002808(x)=A256388(n+3), an(x)=A153196(n+2)
For example: A002808(26)=A256388(3+3), an(26)=A153196(3+2).
A243811 is the list of the second values in successive rows with length 4.
A047845 is the list of values in the second column and A104279 is the list of values in the third column of the jagged array starting on the second row.
Sequence written as an irregular triangle C with new row when a(n)=1:
1,2,3,
1,4,5,6,2,7,8,9,3,10,11,
1,12,4,13,14,15,5,16,2,17,18,6,19,20,21,7,22,23,
1,24,8,25,26,3,27,9,28,29,30,10,31,4,32,33,11,34,35,36,12,37,2,38,39,13,40,41,5,42,14,43,44,3,45,15,46,6,47,48,16,49,50,51,17,52,53,54,18,55,56,7,57,19,58,4,59.
A243887 is the last value in each row of C.
The second value D on the row n > 1 of the irregular triangle C is a(A053683(n)) or equivalently A084921(n). For example for row 3 of the irregular triangle:
D = a(A053683(3)) = a(16) = 12 or D = A084921(3) = 12. This is the number of composites < A066872(3) with the same least prime factor p as the A053683(3) = 16th composite, A066872(3) = 26.
The number of values in each row of the irregular triangle C begins: 3,11,18,57,39,98,61,141,265,104,351,268,...
The second row of the irregular triangle C is A117385(b) for 3 < b < 15.
The third row of the irregular triangle C has similar values as A117385 in different order.

Examples

			First composite 4, least prime factor is 2, first case for 2 so a(1)=1.
Next composite 6, least prime factor is 2, second case for 2 so a(2)=2.
Next composite 8, least prime factor is 2, third case for 2 so a(3)=3.
Next composite 9, least prime factor is 3, first case for 3 so a(4)=1.
Next composite 10, least prime factor is 2, fourth case for 2 so a(5)=4.
		

Crossrefs

Programs

  • Mathematica
    counts = {}
    values = {}
    For[i = 2, i < 130, i = i + 1,
    If[PrimeQ[i], ,
    x = PrimePi[FactorInteger[i][[1, 1]]];
      If[Length[counts] >= x,
       counts[[x]] = counts[[x]] + 1;
       AppendTo[values, counts[[x]]], AppendTo[counts, 1];
       AppendTo[values, 1]]]]
       (* Print[counts] *)
       Print[values]
  • PARI
    c(n) = for(k=0, primepi(n), isprime(n++)&&k--); n; \\ A002808
    a(n) = my(c=c(n), lpf = vecmin(factor(c)[,1]), nb=0); for(k=2, c, if (!isprime(k) && vecmin(factor(k)[,1])==lpf, nb++)); nb; \\ Michel Marcus, Feb 10 2019

Formula

a(n) is approximately equal to A002808(n)*(A038110(x)/A038111(x)), with A000040(x)=A020639(A002808(n)).
For example if n=325, a(325)~= A002808(325)*(A038110(2)/A038111(2)) with A000040(2)=A020639(A002808(325)).
This gives an estimate of 67.499... and the actual value of a(n)=67.
Showing 1-3 of 3 results.