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 11-14 of 14 results.

A357490 Numbers k such that the k-th composition in standard order has integer geometric mean.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 10, 15, 16, 17, 24, 31, 32, 36, 42, 63, 64, 69, 70, 81, 88, 98, 104, 127, 128, 136, 170, 255, 256, 277, 278, 282, 292, 325, 326, 337, 344, 354, 360, 394, 418, 424, 511, 512, 513, 514, 515, 528, 547, 561, 568, 640, 682, 768, 769, 785, 792, 896
Offset: 1

Views

Author

Gus Wiseman, Oct 16 2022

Keywords

Comments

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 terms together with their corresponding compositions begin:
   1: (1)
   2: (2)
   3: (1,1)
   4: (3)
   7: (1,1,1)
   8: (4)
  10: (2,2)
  15: (1,1,1,1)
  16: (5)
  17: (4,1)
  24: (1,4)
  31: (1,1,1,1,1)
  32: (6)
  36: (3,3)
  42: (2,2,2)
  63: (1,1,1,1,1,1)
  64: (7)
  69: (4,2,1)
		

Crossrefs

For regular mean we have A096199, counted by A271654 (partitions A067538).
Subsets whose geometric mean is an integer are counted by A326027.
The unordered version (partitions) is A326623, counted by A067539.
The strict case is counted by A339452, partitions A326625.
These compositions are counted by A357710.
A078175 lists numbers whose prime factors have integer average.
A320322 counts partitions whose product is a perfect power.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],IntegerQ[GeometricMean[stc[#]]]&]

A358331 Number of integer partitions of n with arithmetic and geometric mean differing by one.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 3, 3, 0, 0, 2, 2, 0, 4, 0, 0, 5, 0, 0, 4, 5, 4, 3, 2, 0, 3, 3, 10, 4, 0, 0, 7, 0, 0, 16, 2, 4, 4, 0, 0, 5, 24, 0, 6, 0, 0, 9, 0, 27, 10, 0, 7, 7, 1, 0, 44
Offset: 0

Views

Author

Gus Wiseman, Nov 09 2022

Keywords

Comments

The arithmetic and geometric mean from such partition is a positive integer. - David A. Corneth, Nov 11 2022

Examples

			The a(30) = 2 through a(36) = 3 partitions (C = 12, G = 16):
  (888222)      .  (99333311)  (G2222222111)  .  (C9662)    (G884)
  (8844111111)                                   (C9833)    (888222111111)
                                                 (8884421)  (G42222221111)
		

Crossrefs

The version for subsets seems to be close to A178832.
These partitions are ranked by A358332.
A000041 counts partitions.
A067538 counts partitions with integer average, ranked by A316413.
A067539 counts partitions with integer geometric mean, ranked by A326623.
A078175 lists numbers whose prime factors have integer average.
A320322 counts partitions whose product is a perfect power.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Mean[#]==1+GeometricMean[#]&]],{n,0,30}]
  • PARI
    a(n) = if (n, my(nb=0,vp); forpart(p=n, vp=Vec(p); if (vecsum(vp)/#p == 1 + sqrtn(vecprod(vp), #p), nb++)); nb, 0); \\ Michel Marcus, Nov 11 2022
    
  • Python
    from math import prod
    from sympy import divisors, integer_nthroot
    from sympy.utilities.iterables import partitions
    def A358331(n):
        divs = {d:n//d-1 for d in divisors(n,generator=True)}
        return sum(1 for s,p in partitions(n,m=max(divs,default=0),size=True) if s in divs and (t:=integer_nthroot(prod(a**b for a, b in p.items()),s))[1] and divs[s]==t[0]) # Chai Wah Wu, Sep 24 2023

Extensions

a(61)-a(80) from Giorgos Kalogeropoulos, Nov 11 2022
a(81)-a(84) from Chai Wah Wu, Sep 24 2023

A358332 Numbers whose prime indices have arithmetic and geometric mean differing by one.

Original entry on oeis.org

57, 228, 1064, 1150, 1159, 2405, 3249, 7991, 29785, 29999, 30153, 35378, 51984, 82211, 133931, 185193, 187039, 232471, 242592, 374599, 404225, 431457, 685207, 715129, 927288, 1132096, 1165519, 1322500, 1343281, 1555073, 1872413, 2016546, 2873687, 3468319, 4266421, 4327344
Offset: 1

Views

Author

Gus Wiseman, Nov 09 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The terms together with their prime indices begin:
      57: {2,8}
     228: {1,1,2,8}
    1064: {1,1,1,4,8}
    1150: {1,3,3,9}
    1159: {8,18}
    2405: {3,6,12}
    3249: {2,2,8,8}
    7991: {18,32}
   29785: {3,4,9,12}
   29999: {32,50}
   30153: {2,8,9,9}
   35378: {1,4,4,8,8}
   51984: {1,1,1,1,2,2,8,8}
   82211: {50,72}
  133931: {4,8,8,16}
  185193: {2,2,2,8,8,8}
  187039: {72,98}
  232471: {12,18,27}
		

Crossrefs

The partitions with these Heinz numbers are counted by A358331.
A000040 lists the primes.
A001222 counts prime indices, distinct A001221.
A003963 multiplies together prime indices.
A056239 adds up prime indices.
A067538 counts partitions with integer average, ranked by A316413.
A067539 counts partitions with integer geometric mean, ranked by A326623.
A078175 lists numbers whose prime factors have integer average.
A320322 counts partitions whose product is a perfect power.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[10000],Mean[primeMS[#]]==1+GeometricMean[primeMS[#]]&]
  • PARI
    isok(k) = if (k>1, my(f=factor(k), vf=List()); for (i=1, #f~, for (j=1, f[i,2], listput(vf, primepi(f[i,1])))); my(v = Vec(vf)); vecsum(v)/#v == 1 + sqrtn(vecprod(v), #v);); \\ Michel Marcus, Nov 11 2022

Extensions

More terms from Michel Marcus, Nov 11 2022

A327777 Prime numbers whose binary indices have integer mean and integer geometric mean.

Original entry on oeis.org

2, 257, 8519971, 36574494881, 140739702949921, 140773995710729, 140774004099109
Offset: 1

Views

Author

Gus Wiseman, Sep 27 2019

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
Conjecture: This sequence is infinite.

Examples

			The initial terms together with their binary indices:
                2: {2}
              257: {1,9}
          8519971: {1,2,6,9,18,24}
      36574494881: {1,6,8,16,18,27,32,36}
  140739702949921: {1,6,12,27,32,48}
  140773995710729: {1,4,9,12,18,32,36,48}
  140774004099109: {1,3,6,12,18,24,32,36,48}
		

Crossrefs

A subset of A327368.
The binary weight of prime(n) is A014499(n), with binary length A035100(n).
Heinz numbers of partitions with integer mean: A316413.
Heinz numbers of partitions with integer geometric mean: A326623.
Heinz numbers with both: A326645.
Subsets with integer mean: A051293
Subsets with integer geometric mean: A326027
Subsets with both: A326643
Partitions with integer mean: A067538
Partitions with integer geometric mean: A067539
Partitions with both: A326641
Strict partitions with integer mean: A102627
Strict partitions with integer geometric mean: A326625
Strict partitions with both: A326029
Factorizations with integer mean: A326622
Factorizations with integer geometric mean: A326028
Factorizations with both: A326647
Numbers whose binary indices have integer mean: A326669
Numbers whose binary indices have integer geometric mean: A326673
Numbers whose binary indices have both: A327368

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Prime[Range[1000]],IntegerQ[Mean[bpe[#]]]&&IntegerQ[GeometricMean[bpe[#]]]&]

Extensions

a(4)-a(7) from Giovanni Resta, Dec 01 2019
Previous Showing 11-14 of 14 results.