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.

Previous Showing 51-60 of 64 results. Next

A337460 Numbers k such that the k-th composition in standard order is a non-unimodal triple.

Original entry on oeis.org

22, 38, 44, 70, 76, 88, 134, 140, 148, 152, 176, 262, 268, 276, 280, 296, 304, 352, 518, 524, 532, 536, 552, 560, 592, 608, 704, 1030, 1036, 1044, 1048, 1064, 1072, 1096, 1104, 1120, 1184, 1216, 1408, 2054, 2060, 2068, 2072, 2088, 2096, 2120, 2128, 2144, 2192
Offset: 1

Views

Author

Gus Wiseman, Sep 18 2020

Keywords

Comments

These are triples matching the pattern (2,1,2), (3,1,2), or (2,1,3).
A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The sequence together with the corresponding triples begins:
      22: (2,1,2)     296: (3,2,4)    1048: (6,1,4)
      38: (3,1,2)     304: (3,1,5)    1064: (5,2,4)
      44: (2,1,3)     352: (2,1,6)    1072: (5,1,5)
      70: (4,1,2)     518: (7,1,2)    1096: (4,3,4)
      76: (3,1,3)     524: (6,1,3)    1104: (4,2,5)
      88: (2,1,4)     532: (5,2,3)    1120: (4,1,6)
     134: (5,1,2)     536: (5,1,4)    1184: (3,2,6)
     140: (4,1,3)     552: (4,2,4)    1216: (3,1,7)
     148: (3,2,3)     560: (4,1,5)    1408: (2,1,8)
     152: (3,1,4)     592: (3,2,5)    2054: (9,1,2)
     176: (2,1,5)     608: (3,1,6)    2060: (8,1,3)
     262: (6,1,2)     704: (2,1,7)    2068: (7,2,3)
     268: (5,1,3)    1030: (8,1,2)    2072: (7,1,4)
     276: (4,2,3)    1036: (7,1,3)    2088: (6,2,4)
     280: (4,1,4)    1044: (6,2,3)    2096: (6,1,5)
		

Crossrefs

A000212 counts unimodal triples.
A000217(n - 2) counts 3-part compositions.
A001399(n - 3) counts 3-part partitions.
A001399(n - 6) counts 3-part strict partitions.
A001399(n - 6)*2 counts non-unimodal 3-part strict compositions.
A001399(n - 6)*4 counts unimodal 3-part strict compositions.
A001399(n - 6)*6 counts 3-part strict compositions.
A001523 counts unimodal compositions.
A001840 counts non-unimodal triples.
A059204 counts non-unimodal permutations.
A115981 counts non-unimodal compositions.
A328509 counts non-unimodal patterns.
A337459 ranks unimodal triples.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Triples are A014311.
- Sum is A070939.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Heinz number is A333219.
- Non-unimodal compositions are A335373.
- Non-co-unimodal compositions are A335374.
- Strict triples are A337453.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],Length[stc[#]]==3&&MatchQ[stc[#],{x_,y_,z_}/;x>y
    				

Formula

Intersection of A014311 and A335373.

A038463 Sums of 12 distinct powers of 2.

Original entry on oeis.org

4095, 6143, 7167, 7679, 7935, 8063, 8127, 8159, 8175, 8183, 8187, 8189, 8190, 10239, 11263, 11775, 12031, 12159, 12223, 12255, 12271, 12279, 12283, 12285, 12286, 13311, 13823, 14079, 14207, 14271, 14303, 14319, 14327, 14331, 14333
Offset: 1

Views

Author

Keywords

Crossrefs

Base 2 interpretation of A038454.
Cf. A000079, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691, A038461, A038462 (Hamming weight = 1, 2, ..., 11).

Programs

  • Mathematica
    Select[Range[15000], DigitCount[#, 2, 1] == 12 &] (* Amiram Eldar, Feb 14 2022 *)
  • Python
    from itertools import islice
    def A038463_gen(): # generator of terms
        yield (n:=4095)
        while True: yield (n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A038463_list = list(islice(A038463_gen(),20)) # Chai Wah Wu, Mar 10 2025

Formula

Sum_{n>=1} 1/a(n) = 1.386296350824871649202152615241744383837323713474767661902780220440945591424... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A212192 Triangular numbers that are the sum of exactly three distinct powers of 2.

Original entry on oeis.org

21, 28, 276, 1540
Offset: 1

Views

Author

Reinhard Zumkeller, May 03 2012

Keywords

Comments

Triangular numbers with exactly three ones in their binary representation: A000120(a(n)) = 3; triangular numbers in A014311; no more terms less than A014311(1000000) = 6129982174881536975083663305496791903885182827960991744.

Crossrefs

Programs

  • Haskell
    a212192 n = a212192_list !! (n-1)
    a212192_list = filter ((== 1) . a010054) a014311_list
  • Mathematica
    Select[Accumulate[Range[60]],Total[IntegerDigits[#,2]]==3&] (* Harvey P. Dale, Mar 11 2023 *)

A338469 Products of three odd prime numbers of odd index.

Original entry on oeis.org

125, 275, 425, 575, 605, 775, 935, 1025, 1175, 1265, 1331, 1445, 1475, 1675, 1705, 1825, 1955, 2057, 2075, 2255, 2425, 2575, 2585, 2635, 2645, 2725, 2783, 3175, 3179, 3245, 3425, 3485, 3565, 3685, 3725, 3751, 3925, 3995, 4015, 4175, 4301, 4475, 4565, 4715
Offset: 1

Views

Author

Gus Wiseman, Nov 08 2020

Keywords

Comments

Also Heinz numbers of integer partitions with 3 parts, all of which are odd and > 1. These partitions are counted by A001399.

Examples

			The sequence of terms together with their prime indices begins:
     125: {3,3,3}     1825: {3,3,21}    3425: {3,3,33}
     275: {3,3,5}     1955: {3,7,9}     3485: {3,7,13}
     425: {3,3,7}     2057: {5,5,7}     3565: {3,9,11}
     575: {3,3,9}     2075: {3,3,23}    3685: {3,5,19}
     605: {3,5,5}     2255: {3,5,13}    3725: {3,3,35}
     775: {3,3,11}    2425: {3,3,25}    3751: {5,5,11}
     935: {3,5,7}     2575: {3,3,27}    3925: {3,3,37}
    1025: {3,3,13}    2585: {3,5,15}    3995: {3,7,15}
    1175: {3,3,15}    2635: {3,7,11}    4015: {3,5,21}
    1265: {3,5,9}     2645: {3,9,9}     4175: {3,3,39}
    1331: {5,5,5}     2725: {3,3,29}    4301: {5,7,9}
    1445: {3,7,7}     2783: {5,5,9}     4475: {3,3,41}
    1475: {3,3,17}    3175: {3,3,31}    4565: {3,5,23}
    1675: {3,3,19}    3179: {5,7,7}     4715: {3,9,13}
    1705: {3,5,11}    3245: {3,5,17}    4775: {3,3,43}
		

Crossrefs

A046316 allows all primes (strict: A046389).
A338471 allows all odd primes (strict: A307534).
A338556 is the version for evens (strict: A338557).
A000009 counts partitions into odd parts (strict: A000700).
A001399(n-3) counts 3-part partitions (strict: A001399(n-6)).
A005408 lists odds (strict: A056911).
A008284 counts partitions by sum and length.
A014311 is a ranking of 3-part compositions (strict: A337453).
A014612 lists Heinz numbers of 3-part partitions (strict: A007304).
A023023 counts 3-part relatively prime partitions (strict: A101271).
A066207 lists numbers with all even prime indices (strict: A258117).
A066208 lists numbers with all odd prime indices (strict: A258116).
A075818 lists even Heinz numbers of 3-part partitions (strict: A075819).
A285508 lists Heinz numbers of non-strict 3-part partitions.

Programs

  • Maple
    N:= 10000: # for terms <= N
    P0:= [seq(ithprime(i),i=3..numtheory:-pi(floor(N/25)),2)]:
    sort(select(`<=`,[seq(seq(seq(P0[i]*P0[j]*P0[k],k=1..j),j=1..i),i=1..nops(P0))], N)); # Robert Israel, Nov 12 2020
  • Mathematica
    Select[Range[1,1000,2],PrimeOmega[#]==3&&OddQ[Times@@PrimePi/@First/@FactorInteger[#]]&]
  • PARI
    isok(m) = my(f=factor(m)); (m%2) && (bigomega(f)==3) && (#select(x->!(x%2), apply(primepi, f[,1]~)) == 0); \\ Michel Marcus, Nov 10 2020
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A338469(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x-sum((primepi(x//(k*m))+1>>1)-(b+1>>1)+1 for a,k in filter(lambda x:x[0]&1,enumerate(primerange(5,integer_nthroot(x,3)[0]+1),3)) for b,m in filter(lambda x:x[0]&1,enumerate(primerange(k,isqrt(x//k)+1),a))))
        return bisection(f,n,n) # Chai Wah Wu, Oct 18 2024

A340068 a(n) is the number of integers in the set {n+1,n+2, . . . ,2n} whose representation in base 2 contain exactly three digits 1’s.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 6, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 17, 17, 18, 18, 18, 18, 19
Offset: 1

Views

Author

Bernard Schott, Dec 28 2020

Keywords

Comments

This sequence is inspired by the 3rd problem, proposed by Romania, during the 35th International Mathematical Olympiad in 1994 at Hong Kong (see the link IMO).
This sequence is increasing because there are only these two possibilities:
-> a(n+1) - a(n) = 1 if n has exactly two 1's in its binary representation (A018900);
-> a(n+1) - a(n) = 0 otherwise.
Consequence, for any positive integer m, a(x) = m has at least one solution (answer to the 1st Olympiad question).
Only when m = k*(k-1)/2 + 1 with k >= 2 (A000124 \ {1}), there exists only one n such that a(n) = m, and then n = 2^k+2 where k >= 2 (A052548 \ {3, 4}) (answer to the 2nd Olympiad question).

Examples

			a(2) = 0 because in {3, 4}, 3 = 11_2 and 4 = 100_2.
a(4) = 1 because in {5, 6, 7, 8, 9, 10} only 7 = 111_2 has 3 digits in its binary representation.
a(6) = 2 because in {7, 8, 9, 10, 11, 12}, there are 7 = 111_2 and 11 = 1011_2 that have 3 digits in their binary representation.
		

References

  • Marcin E. Kuczma, International Mathematical Olympiads, 1986-1999, The Mathematical Association of America, 2003, pages 10 and 92-93.

Crossrefs

Cf. A000120, A014311, A018900, A057168, A151774 (first differences).

Programs

Formula

a(2^k+2) = k*(k-1)/2 + 1 for k >= 2.

Extensions

More terms from David A. Corneth, Dec 28 2020

A095736 Numbers with binary weight (A000120) <= 3.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 44, 48, 49, 50, 52, 56, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 80, 81, 82, 84, 88, 96, 97, 98, 100, 104, 112, 128, 129, 130, 131, 132, 133, 134, 136
Offset: 1

Views

Author

N. J. A. Sloane, Jun 23 2009

Keywords

Comments

There are O(log^4 x) members of this sequence up to x. - Charles R Greathouse IV, Mar 29 2013

Crossrefs

Programs

Formula

Sum_{n>=2} 1/a(n) = 4.957591106549526542379494338911534917897082748621184321529665450307117309571... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

A280872 Primes that have exactly 7 zeros and 7 ones in their binary expansion.

Original entry on oeis.org

8287, 8311, 8317, 8423, 8429, 8527, 8539, 8563, 8599, 8627, 8629, 8647, 8677, 8681, 8689, 8783, 8807, 8819, 8821, 8861, 8933, 8999, 9011, 9013, 9043, 9049, 9059, 9109, 9137, 9157, 9161, 9277, 9319, 9323, 9337, 9371, 9397, 9419, 9421, 9433, 9511, 9547, 9613, 9619
Offset: 1

Views

Author

K. D. Bajpai, Jan 09 2017

Keywords

Examples

			8287 is in the sequence because it is a prime and its binary expansion 10000001011111 contains exactly 7 zeros and 7 ones.
9161 is in the sequence because it is a prime and its binary expansion 10001111001001 contains exactly 7 zeros and 7 ones.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t) and convert(convert(t,base,2),`+`)=7, [seq(i,i=2^13+1..2^14-1,2)]); # Robert Israel, Jan 09 2017
  • Mathematica
    Select[Prime[Range[50000]], Count[IntegerDigits[#, 2], 0] == Count[IntegerDigits[#, 2], 1] == 7 &]
    Select[FromDigits[#,2]&/@(Join[{1},#]&/@Permutations[ {1,1,1,1,1,1,0,0,0,0,0,0,0}]),PrimeQ]//Union (* Harvey P. Dale, May 10 2019 *)

A281004 Numbers with exactly 3 ones in both binary and ternary representations.

Original entry on oeis.org

13, 37, 41, 49, 67, 97, 131, 133, 145, 193, 259, 265, 273, 289, 385, 517, 529, 577, 1027, 1029, 1033, 1041, 1153, 1281, 2053, 2057, 4101, 4105, 4113, 4129, 4161, 6145, 8195, 8197, 8209, 8225, 8257, 8321, 8449, 8705, 10241, 16449, 17409, 18433, 20481, 24577, 32771, 32777, 32785, 32801, 32833, 32897
Offset: 1

Views

Author

Robert Israel, Jan 12 2017

Keywords

Comments

Intersection of A014311 and A023694.
All terms are odd, since n == A062756(n) (mod 2).
It is likely that a(136) = 1099528404993 is the last term. The next term, if any, is greater than 10^200.

Examples

			a(4) = 49 = 110001_2 = 1211_3.
		

Crossrefs

Cf. A014311, A023694, A062756. Contains A280997.

Programs

  • Maple
    R:= NULL: count:= 0:
    for a from 2 while count < 136 do
      for b from 1 to a-1  do
        p:= 2^a + 2^b + 1;
        if numboccur(1, convert(p,base,3)) = 3 then
          count:= count+1;
          R:= R, p;
        fi
    od od:
    R;

A359369 a(1) = 1. Thereafter a(n) = Sum_{j=1..n} {b(a(j)), where b(a(j)) = b(a(n))}, and b is A000120.

Original entry on oeis.org

1, 1, 2, 3, 2, 4, 5, 4, 6, 6, 8, 7, 3, 10, 12, 14, 6, 16, 8, 9, 18, 20, 22, 9, 24, 26, 12, 28, 15, 4, 10, 30, 8, 11, 18, 32, 12, 34, 36, 38, 21, 24, 40, 42, 27, 12, 44, 30, 16, 13, 33, 46, 20, 48, 50, 36, 52, 39, 24, 54, 28, 42, 45, 32, 14, 48, 56, 51, 36, 58, 40, 60, 44, 54, 48, 62, 5
Offset: 1

Views

Author

David James Sycamore, Dec 28 2022

Keywords

Comments

In other words, if k numbers having weight w have occurred, the most recent being a(n-1), then a(n) = k*w. Consequently every integer m > 1 appears A000005(m) times. Whilst there are > 2 ways composite number m may appear, there are only two ways for prime p. The first is consequent to the p_th occurrence of a power of 2. The final appearance of any number m is consequent to the first term in the sequence whose weight is m. For this reason final occurrences are very much delayed.
1 appears twice since A000120(1) = 1, the only fixed point in A000120.
First occurrences of primes are in natural order.
It appears that a(n) <= n, with equality at fixed points 1, 26, 28, ...
The plots have a curious net-like structure.
From Michael De Vlieger, Dec 29 2022: (Start)
a(186) = 188, and for n <= 2^20, there are 694462 occasions of a(n) > n.
Let w(n) = A000120(n) and let c_w(k) be the number of k in this sequence with binary weight w(k). Then this sequence consists of the recursive mapping of f(n) = w(a(n-1)) * c_w(a(n-1)).
Since f(n) is a product of 2 positive numbers, a(n) is odd iff both w(a(n-1)) and c_w(a(n-1)) are odd.
Let S_m = { k : w(k) = m }, thus, S_0 = {0}, S_1 = A000079, S_2 = A018900, S_3 = A014311, etc., with least element (2^m)-1 for m > 0.
Let trajectory T_m comprise a(j) such that w(a(j)) = m. Then a(j) is in S_m.
If the a(j) in T_m appear in order of j, then T_m(1) is such that c_m = 1, T_m(2) is such that c_m = 2, and generally c_m(T_m(k)) = k.
This sequence is composed of trajectories T_m evident in scatterplot. (End)

Examples

			1 appears twice only, first as given starting term a(1), then as a(2) = 1.
a(7) = 5, consequent to a(6)=4, the 5th term so far with binary weight = 1.
a(77) = 5, consequent to a(76) = 62, the first occurrence of a term with binary weight = 5. These are the only occurrences of 5 in the sequence.
The first occurrence of 8 is a(11), following a(10) = 6, the fourth term with weight 2.
a(11) = 8 is the 7th term with weight 1, and a(12) is the first occurrence of 7.
		

Crossrefs

Programs

  • Mathematica
    Block[{a, c, f, k, nn}, nn = 76; c[] = 0; a[1] = 1; f[n] := DigitCount[n, 2, 1]; Do[Set[k, ( c[#]++; # c[#]) &[f[#]]] &@a[n - 1]; Set[a[n], k], {n, 2, nn}]; Array[a, nn] ] (* Michael De Vlieger, Dec 28 2022 *)

A086772 Store the natural numbers in a triangular array such that values on each row have the same number of bits. Start a new row with the smallest number not yet recorded. a(n) represents the initial terms in the resulting array.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 15, 21, 24, 31, 41, 45, 63, 64, 72, 74, 83, 94, 127, 139, 140, 173, 197, 207, 234, 255, 268, 284, 288, 339, 349, 390, 426, 445, 467, 511, 522, 553, 569, 634, 689, 706, 734, 797, 838, 934, 950, 951, 1023, 1036, 1052, 1078, 1179, 1236
Offset: 0

Views

Author

Alford Arnold, Aug 03 2003

Keywords

Comments

A067576 describes the sequences with a fixed number of binary bits using antidiagonals.

Examples

			The array begins:
   0
   1  2
   3  5  6
   4  8 16 32
   7 11 13 14 19
   9 10 12 17 18 20
  15 23 27 29 30 39 43
  ...
so the initial terms are 0 1 3 4 7 9 15 ...
		

Crossrefs

Programs

  • Maple
    A086772aux := proc(n,k)
        option remember;
        local a,npr,kpr,fnd ;
        if n = 0 then
            return 0;
        end if;
        if k = 0 then
            for a from 1 do
                fnd := false;
                for npr from 1 to n-1 do
                    for kpr from 0 to npr do
                        if procname(npr,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                end do:
                if not fnd then
                    return a;
                end if;
            end do:
        else
            for a from 1 do
                if wt(a) = wt(procname(n,0)) then
                    fnd := false;
                    for npr from 1 to n-1 do
                        for kpr from 0 to npr do
                            if procname(npr,kpr) = a then
                                fnd := true;
                                break;
                            end if;
                        end do:
                    end do:
                    for kpr from 0 to k-1 do
                        if procname(n,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                    if not fnd then
                        return a;
                    end if;
                end if;
            end do:
        end if;
    end proc:
    A086772 := proc(n)
        A086772aux(n,0) ;
    end proc: # R. J. Mathar, Sep 15 2012
Previous Showing 51-60 of 64 results. Next