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: Giuseppe Melfi

Giuseppe Melfi's wiki page.

Giuseppe Melfi has authored 6 sequences.

A357439 Sums of squares of two odd primes.

Original entry on oeis.org

18, 34, 50, 58, 74, 98, 130, 146, 170, 178, 194, 218, 242, 290, 298, 314, 338, 370, 386, 410, 458, 482, 530, 538, 554, 578, 650, 698, 722, 818, 850, 866, 890, 962, 970, 986, 1010, 1058, 1082, 1130, 1202, 1250, 1322, 1370, 1378, 1394, 1418, 1490, 1538, 1658, 1682
Offset: 1

Author

Giuseppe Melfi, Oct 06 2022

Keywords

Comments

Although this is twice A143850, it is important enough to warrant an entry of it own. - N. J. A. Sloane, Oct 10 2022

Crossrefs

A327621 Sums of distinct powers of 3 and powers of 4 (greater than 1).

Original entry on oeis.org

3, 4, 7, 9, 12, 13, 16, 19, 20, 23, 25, 27, 28, 29, 30, 31, 32, 34, 36, 39, 40, 43, 46, 47, 50, 52, 55, 56, 59, 64, 67, 68, 71, 73, 76, 77, 80, 81, 83, 84, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 101, 103, 104, 106, 107, 108, 109, 110, 111, 112
Offset: 1

Author

Giuseppe Melfi, Sep 19 2019

Keywords

Comments

From M. F. Hasler, Nov 16 2023: (Start)
Record gaps in this sequence are : a(2) - a(1) = 1, a(3) - a(2) = 3, a(30) - a(29) = 5, a(112) - a(111) = 39, a(9863) - a(9862) = 1084, a(34096) - a(34095) = 7682, ...
These gaps are closely related to the gaps in the set where 3^0 and 4^0 are (both) also allowed to be in the sum, in which case the first missing numbers are A367090 = (62, 63, 143, 144, 207, ...), see also Melfi's paper. It is obvious that the study of these gaps is crucial for the proof of Erdös conjecture.
The record gap a(9863) - a(9862) = 1084 explains the discontinuity seen in the graph of a(1..10^4). (End)

Examples

			40 is in the sequence because 40 = 27 + 9 + 4.
		

Crossrefs

Cf. A000244 (powers of 3), A000302 (powers of 4).
Cf. A005836 and A000695 (sums of distinct powers of 3 and of 4).

Programs

  • Mathematica
    f[b_, m_] := Select[b Range[0, m/b], Max@ IntegerDigits[#, b] < 2 &]; mx=200; Union@ Select[Total /@ Tuples[{f[3, mx], f[4, mx]}], 0 < # < mx &] (* Giovanni Resta, Sep 19 2019 *)
  • PARI
    A327621_upto(N, S=[0])={for(b=3,4, for(k=1, logint(N,b), my(p=b^k); S=setunion(S,[x+p|x<-S,x+p<=N])));S[^1]} \\ M. F. Hasler, Nov 02 2023
    
  • Python
    def A327621_upto(N):
        "list(x < N | x = sum(3^j, j in J) + sum(4^k, k in K); J, K subset N*)."
        S = {0} # empty sum
        for b in (3,4):
            p = b
            while p < N: S |= {k+p for k in S if k+p < N} ; p *= b
        return sorted(S) # includes a(0) = 0, so a(1,2,3,...) = 3,4,9,...
    # M. F. Hasler, Nov 09 2023

Formula

For A(x) the enumerating function, Erdős conjectured that A(x) > c*x.
G. Melfi proved that A(x) > x^0.965 for sufficiently large x.

Extensions

More terms from Giovanni Resta, Sep 19 2019

A325423 Numbers k such that sigma(2*k+1) >= sigma(2*k).

Original entry on oeis.org

1, 7, 31, 37, 67, 73, 97, 103, 127, 157, 199, 202, 229, 241, 247, 262, 277, 283, 307, 313, 331, 337, 346, 367, 379, 382, 397, 409, 427, 457, 472, 487, 499, 517, 547, 562, 577, 607, 619, 643, 661, 667, 682, 697, 727, 757, 769, 787
Offset: 1

Author

Giuseppe Melfi, Sep 06 2019

Keywords

Comments

The function A(x) enumerating the terms not exceeding x has the property that lim_{x->oo} A(x)/x exists (Hildebrand, 1990).

Examples

			7 is in the sequence because sigma(14) = 1+2+7+14 = 24 <= sigma(15) = 1+3+5+15 = 24;
31 is in the sequence because sigma(62) = 1+2+31+62 = 96 <= sigma(63) = 1+3+7+9+21+63 = 104.
		

References

  • M. Laub, Advanced Problems: 6555. The American Mathematical Monthly, 94(8), 800 (1987). doi:10.2307/2323430.

Crossrefs

Cf. A082957.

Programs

Formula

a(n) ~ c*n with 18.2 < c < 18.6 (claimed by Kobayashi and Trudgian).

A083567 Let B(k) be the number of binary digits in k equal to 1. This is the sequence of positive integers k such that 2B(k)=B(k^2).

Original entry on oeis.org

21, 37, 42, 45, 53, 69, 73, 74, 81, 83, 84, 90, 106, 133, 137, 138, 141, 146, 148, 155, 161, 162, 165, 166, 168, 177, 180, 211, 212, 261, 265, 266, 269, 273, 274, 276, 281, 282, 289, 291, 292, 295, 296, 299, 310, 321, 322, 324, 330, 332, 336, 354, 359, 360
Offset: 1

Author

Giuseppe Melfi, Jun 13 2003

Keywords

Comments

This includes all k > 1 such that the average of ones in the binary expansion of k is the same of the average of ones in binary expansion of k^2; these are the values in the sequence with sqrt(2)*2^j < a(k) < 2^(j+1) for some j. - Corrected by Franklin T. Adams-Watters, Aug 23 2012
Conjecture: The counting function p(n) satisfies p(n)=c n/log n + o(n/log n).

Examples

			21 is in the sequence because 21=10101_2 (3 1's) and 441=110111001_2 (6 1's).
		

Crossrefs

Programs

  • Maple
    select(t -> 2*convert(convert(t,base,2),`+`) = convert(convert(t^2,base,2),`+`), [$1..1000]); # Robert Israel, Aug 27 2015
  • Mathematica
    f[n_] := Total@ IntegerDigits[n, 2]; Select[Range@ 360, 2 f@ # == f[#^2] &] (* Michael De Vlieger, Aug 27 2015 *)
  • PARI
    isok(n) =  norml2(binary(n^2)) == 2*norml2(binary(n)) \\ Michel Marcus, Jun 20 2013

A077436 Let B(n) be the sum of binary digits of n. This sequence contains n such that B(n) = B(n^2).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 79, 91, 96, 112, 120, 124, 126, 127, 128, 157, 158, 159, 182, 183, 187, 192, 224, 240, 248, 252, 254, 255, 256, 279, 287, 314, 316, 317, 318, 319, 351, 364, 365, 366, 374, 375, 379, 384
Offset: 1

Author

Giuseppe Melfi, Nov 30 2002

Keywords

Comments

Superset of A023758.
Hare, Laishram, & Stoll show that this sequence contains infinitely many odd numbers. In particular for each k in {12, 13, 16, 17, 18, 19, 20, ...} there are infinitely many terms in this sequence with binary digit sum k. - Charles R Greathouse IV, Aug 25 2015

Examples

			The element 79 belongs to the sequence because 79=(1001111) and 79^2=(1100001100001), so B(79)=B(79^2)
		

Crossrefs

Cf. A211676 (number of n-bit numbers in this sequence).
A261586 is a subsequence. Subsequence of A352084.

Programs

  • Haskell
    import Data.List (elemIndices)
    import Data.Function (on)
    a077436 n = a077436_list !! (n-1)
    a077436_list = elemIndices 0
       $ zipWith ((-) `on` a000120) [0..] a000290_list
    -- Reinhard Zumkeller, Apr 12 2011
    
  • Magma
    [n: n in [0..400] | &+Intseq(n, 2) eq &+Intseq(n^2, 2)]; // Vincenzo Librandi, Aug 30 2015
    
  • Maple
    select(t -> convert(convert(t,base,2),`+`) = convert(convert(t^2,base,2),`+`), [$0..1000]); # Robert Israel, Aug 27 2015
  • Mathematica
    t={}; Do[If[DigitCount[n, 2, 1] == DigitCount[n^2, 2, 1], AppendTo[t, n]], {n, 0, 364}]; t
    f[n_] := Total@ IntegerDigits[n, 2]; Select[Range[0, 384], f@ # == f[#^2] &] (* Michael De Vlieger, Aug 27 2015 *)
  • PARI
    is(n)=hammingweight(n)==hammingweight(n^2) \\ Charles R Greathouse IV, Aug 25 2015
    
  • Python
    def ok(n): return bin(n).count('1') == bin(n**2).count('1')
    print([m for m in range(400) if ok(m)]) # Michael S. Branicky, Mar 11 2022

Formula

A159918(a(n)) = A000120(a(n)). - Reinhard Zumkeller, Apr 25 2009

Extensions

Initial 0 added by Reinhard Zumkeller, Apr 28 2012, Apr 12 2011

A052287 Start with 3; the general rule is "if x is present then so is x*y for every y <= x".

Original entry on oeis.org

3, 6, 9, 12, 18, 24, 27, 30, 36, 45, 48, 54, 60, 63, 72, 81, 84, 90, 96, 108, 120, 126, 132, 135, 144, 150, 162, 168, 180, 189, 192, 198, 210, 216, 225, 234, 240, 243, 252, 264, 270, 288, 297, 300, 306, 312, 315, 324, 330, 336, 351, 360, 378, 384, 390, 396
Offset: 1

Author

Giuseppe Melfi, Feb 08 2000

Keywords

Examples

			63 is an element because 63 = 3*3*7 and 3 <= 3 and 7 <= 3*3.
		

Crossrefs

If instead we start with 2, we obtain the "Nullwertzahlen sequence" A047836.
Cf. A196149.

Programs

  • Haskell
    import Data.List.Ordered (union)
    a052287 n = a052287_list !! (n-1)
    a052287_list = f [3] where
       f (x:xs) = x : f (xs `union` map (x *) [2..x])
    -- Reinhard Zumkeller, Jun 25 2015, Sep 28 2011
  • Maple
    N:= 1000: # get all terms <= N
    S:= {3}:
    New:= {3}:
    while New <> {} do
      x:= New[1];
      New:= subsop(1=NULL,New);
      R:= {seq(k*x, k=1..min(x,N/x))} minus S;
      S:= S union R;
      New:= New union R;
    od:
    sort(convert(S,list));  # Robert Israel, Aug 27 2015
  • Mathematica
    3 Select[Range[132], Max[#[[2]]/#[[1]] & /@ Partition[Divisors[#], 2, 1]] <= 3 &] (* Michael De Vlieger, Aug 27 2015, after Harvey P. Dale at A196149 *)

Formula

x is a term if and only if x = 3*p1*p2*...*pk with primes 2 <= p1 <= p2 <= ... <= pk and 3*p1*p2*...*pi >= p(i+1) for all i < k.
a(n) = 3 * A196149(n). - Reinhard Zumkeller, Sep 28 2011
The number of terms <= x is c*x/log(x) + O(x/(log(x))^2), where c = 0.68514..., and a(n) = C*n*log(n*log(n)) + O(n), where C = 1/c = 1.45954... This follows from the formula just above. - Andreas Weingartner, Jun 30 2021

Extensions

More terms from Reinhard Zumkeller, Jun 22 2003