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-20 of 65 results. Next

A261986 Numbers k such that A003313(k) = A003313(4*k).

Original entry on oeis.org

30958077, 55670941, 61487077, 111031197, 112710897, 113180303, 114523591, 121275479, 121963055, 122830789, 215074411, 215182221, 220162873, 222034845, 222254557, 222661789, 223538781, 225298237, 225414385, 225545245, 225695631, 225718029, 226254877, 226356879
Offset: 1

Views

Author

Hugo Pfoertner, Sep 07 2015

Keywords

Comments

Terms are counterexamples to the conjecture that no shortest addition chains exist such that A003313(m)=A003313(m*2^k) for k>1, with a(1)=30958077 provided in 2008 by Neill M. Clift.

Crossrefs

Cf. A115016, A003313 [l(k)], A086878 [l(k)=l(2*k)], A116459 [l(k)=l(3*k)], A116460 [l(k)=l(5*k)], A116461 [l(k)=l(6*k)], A116462 [l(k)=l(7*k)], A116463 [l(k)=l(9*k)], A117151 [l(k)=l(10*k)].

A230528 Numbers k such that a shortest addition chain for 2*k is shorter than one for k, that is, A003313(2*k) < A003313(k).

Original entry on oeis.org

375494703, 602641031, 619418303, 728117339, 750793519, 750832687, 750989359
Offset: 1

Views

Author

Max Alekseyev, Oct 22 2013

Keywords

Comments

Can the shortest addition chain for 2*k be shorter than one for k by more than 1? - Alexey Slizkov, Jan 20 2024

Crossrefs

Extensions

a(1) = 375494703 was found by Neill M. Clift (2011)
a(2)-a(7) from Hugo Pfoertner, Dec 19 2015

A104699 Numbers n such that A003313(3n) < A003313(n).

Original entry on oeis.org

2731, 5462, 10923, 10924, 13655, 21846, 21848, 27307, 27310, 43691, 43692, 43696, 54614, 54615, 54620, 71003, 87382, 87384, 87392, 92843, 109227, 109228, 109230, 109240, 133819, 142006, 152919, 174763, 174764, 174768
Offset: 1

Views

Author

N. J. A. Sloane, May 23 2008

Keywords

Comments

The first 82 terms are identical to those of A116461 [A003313(6n) = A003313(n)]. The first difference occurs for a(83)=699051. 699051 is not in A116461, because A003313(699051)=24, A003313(3*699051)=22 and A003313(6*699051)=23. - Hugo Pfoertner, Dec 19 2015

Crossrefs

Extensions

Missing term a(21)=109227 from Hugo Pfoertner, Dec 19 2015

A264803 Numbers with largest ratio A003313(k)/log_2(k) in the range 2^n < k < 2^(n+1).

Original entry on oeis.org

3, 7, 11, 29, 47, 71, 191, 379, 607, 1087, 2103, 6271, 11231, 18287, 34303, 110591, 196591, 357887, 685951, 1176431, 2211837, 4210399, 14143037, 25450463, 46444543, 89209343, 155691199, 298695487, 550040063, 1886023151
Offset: 1

Views

Author

Hugo Pfoertner, Dec 17 2015

Keywords

Comments

The corresponding addition chain lengths are given in A253723.
The quotient A003313(k)/log_2(k) has its conjectured maximum of 1.46347481 for k=71. Values of A003313 up to 2^31-1 are obtained from Achim Flammenkamp's web page, which provides a table computed by Neill M. Clift.
In the paper by Wattel & Jensen, the conjectured maximum is proved to hold for all k > 71, too. - Achim Flammenkamp, Nov 01 2016

Examples

			a(3) = 11, because the maximum of quotients of shortest addition chain length l(k) and the base-2 logarithm of the numbers in the range 2^3 ... 2^4 occurs at k=11.
  k l(k) log_2(k) l(k)/log_2(k)
   8  3   3.0000   1.00000
   9  4   3.1699   1.26186
  10  4   3.3219   1.20412
  11  5   3.4594   1.44532
  12  4   3.5849   1.11577
  13  5   3.7004   1.35119
  14  5   3.8074   1.31325
  15  5   3.9069   1.27979
  16  4   4.0000   1.00000
a(30)=1886023151 because it produces the largest value of A003313(k)/log_2(k) in the interval 2^30 < k < 2^31, i.e., all other numbers in this range give a smaller quotient than A003313(1886023151) / log_2(1886023151) = 38 / 30.8127 = 1.23325771.
		

References

  • E. Wattel, G. A. Jensen, Efficient calculation of powers in a semigroup, 1968 in Zuivere Wiskunde 1/68. [From Achim Flammenkamp, Nov 01 2016]

Crossrefs

A229624 Positive integers k for which the length of shortest addition-subtraction chain is smaller than the length of shortest addition chain, i.e., A128998(k) < A003313(k).

Original entry on oeis.org

31, 47, 62, 63, 71, 79, 93, 94, 95, 124, 126, 127, 139, 141, 142, 143, 155, 157, 158, 159, 186, 188, 189, 190, 191, 223, 235, 237, 239, 247, 248, 251, 252, 253, 254, 255, 263, 271, 278, 279, 282, 283, 284, 285, 286, 287, 310, 314, 315, 316, 317, 318, 319, 372
Offset: 1

Views

Author

Max Alekseyev, Sep 27 2013

Keywords

Crossrefs

Extensions

More terms from Jinyuan Wang, Apr 17 2025

A253723 Length of shortest addition chain corresponding to maximum of A003313(k)/log_2(k) in interval 2^n < k < 2^(n+1).

Original entry on oeis.org

2, 4, 5, 7, 8, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 38
Offset: 1

Views

Author

Hugo Pfoertner, Dec 18 2015

Keywords

Comments

The values of k, for which the maximum values are obtained, are given in A264803.

Crossrefs

A371894 Integers k such that the number of multiplications to compute the k-th power by the Chandah-sutra method (A014701) is larger than the length of the shortest addition chain for k (A003313).

Original entry on oeis.org

15, 23, 27, 30, 31, 39, 43, 45, 46, 47, 51, 54, 55, 59, 60, 61, 62, 63, 75, 77, 78, 79, 83, 85, 86, 87, 90, 91, 92, 93, 94, 95, 99, 102, 103, 107, 108, 109, 110, 111, 115, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 143, 147, 149, 150, 151, 153, 154, 155
Offset: 1

Views

Author

Szymon Lukaszyk, Apr 11 2024

Keywords

Comments

All terms have a binary weight A000120(k) >= 4.

Crossrefs

A264802 Position of the n largest occurrences of a shortest addition chain of length n in A003313, written as a triangle.

Original entry on oeis.org

2, 4, 3, 8, 6, 5, 16, 12, 10, 9, 32, 24, 20, 18, 17, 64, 48, 40, 36, 34, 33, 128, 96, 80, 72, 68, 66, 65, 256, 192, 160, 144, 136, 132, 130, 129, 512, 384, 320, 288, 272, 264, 260, 258, 257
Offset: 1

Views

Author

Hugo Pfoertner, Dec 17 2015

Keywords

Comments

The terms are given with latest occurrence first, which corresponds to the addition chain of length n for the number 2^n.

Examples

			Triangle of the n latest occurrences:
    2
    4   3
    8   6   5
   16  12  10   9
   32  24  20  18  17
   64  48  40  36  34  33
  128  96  80  72  68  66  65
  256 192 160 144 136 132 130 129
  512 384 320 288 272 264 260 258 257
		

Crossrefs

Cf. A003313.

A005245 The (Mahler-Popken) complexity of n: minimal number of 1's required to build n using + and *.

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 6, 6, 6, 7, 8, 7, 8, 8, 8, 8, 9, 8, 9, 9, 9, 10, 11, 9, 10, 10, 9, 10, 11, 10, 11, 10, 11, 11, 11, 10, 11, 11, 11, 11, 12, 11, 12, 12, 11, 12, 13, 11, 12, 12, 12, 12, 13, 11, 12, 12, 12, 13, 14, 12, 13, 13, 12, 12, 13, 13, 14, 13, 14, 13, 14, 12, 13, 13, 13, 13, 14, 13, 14
Offset: 1

Views

Author

Keywords

Comments

The complexity of an integer n is the least number of 1's needed to represent it using only additions, multiplications and parentheses. This does not allow juxtaposition of 1's to form larger integers, so for example, 2 = 1+1 has complexity 2, but 11 does not ("pasting together" two 1's is not an allowed operation).
The complexity of a number has been defined in several different ways by different authors. See the Index to the OEIS for other definitions.
Guy asks if a(p) = a(p-1) + 1 for prime p. Martin Fuller found the least counterexample p = 353942783 in 2008, see Fuller link. - Charles R Greathouse IV, Oct 04 2012
It appears that this sequence is lower than A348262 {1,+,^} only a finite number of times. - Gordon Hamilton and Brad Ballinger, May 23 2022
The second Altman links proves that {a(n) - 3*log_3(n)} is a well-ordered subset of the reals whose intersection with [0,k) has order type omega^k for each positive integer k, so this set itself has order type omega^omega. - Jianing Song, Apr 13 2024

Examples

			From _Lekraj Beedassy_, Jul 04 2009: (Start)
   n.........minimal expression........ a(n) = number of 1's
   1..................1...................1
   2.................1+1..................2
   3................1+1+1.................3
   4.............(1+1)*(1+1)..............4
   5............(1+1)*(1+1)+1.............5
   6............(1+1)*(1+1+1).............5
   7...........(1+1)*(1+1+1)+1............6
   8..........(1+1)*(1+1)*(1+1)...........6
   9...........(1+1+1)*(1+1+1)............6
  10..........(1+1+1)*(1+1+1)+1...........7
  11.........(1+1+1)*(1+1+1)+1+1..........8
  12.........(1+1)*(1+1)*(1+1+1)..........7
  13........(1+1)*(1+1)*(1+1+1)+1.........8
  14.......{(1+1)*(1+1+1)+1}*(1+1)........8
  15.......{(1+1)*(1+1)+1}*(1+1+1)........8
  16.......(1+1)*(1+1)*(1+1)*(1+1)........8
  17......(1+1)*(1+1)*(1+1)*(1+1)+1.......9
  18........(1+1)*(1+1+1)*(1+1+1).........8
  19.......(1+1)*(1+1+1)*(1+1+1)+1........9
  20......{(1+1+1)*(1+1+1)+1}*(1+1).......9
  21......{(1+1)*(1+1+1)+1}*(1+1+1).......9
  22.....{(1+1)*(1+1+1)+1}*(1+1+1)+1.....10
  23....{(1+1)*(1+1+1)+1}*(1+1+1)+1+1....11
  24......(1+1)*(1+1)*(1+1)*(1+1+1).......9
  25.....(1+1)*(1+1)*(1+1)*(1+1+1)+1.....10
  26....{(1+1)*(1+1)*(1+1+1)+1}*(1+1)....10
  27.......(1+1+1)*(1+1+1)*(1+1+1)........9
  28......(1+1+1)*(1+1+1)*(1+1+1)+1......10
  29.....(1+1+1)*(1+1+1)*(1+1+1)+1+1.....11
  30.....{(1+1+1)*(1+1+1)+1}*(1+1+1).....10
  31....{(1+1+1)*(1+1+1)+1}*(1+1+1)+1....11
  32....(1+1)*(1+1)*(1+1)*(1+1)*(1+1)....10
  33...(1+1)*(1+1)*(1+1)*(1+1)*(1+1)+1...11
  34..{(1+1)*(1+1)*(1+1)*(1+1)+1}*(1+1)..11
  .........................................
(End)
		

References

  • M. Criton, "Les uns de Germain", Problem No. 4, pp. 13 ; 68 in '7 x 7 Enigmes Et Défis Mathématiques pour tous', vol. 25, Editions POLE, Paris 2001.
  • R. K. Guy, Unsolved Problems in Number Theory, Sect. F26.
  • K. Mahler and J. Popken, Over een Maximumprobleem uit de Rekenkunde (Dutch: On a maximum problem in arithmetic), Nieuw Arch. Wiskunde, (3) 1 (1953), pp. 1-15.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A025280 (variant using +, *, and ^), A091333 (using +, -, and *), A091334 (using +, -, *, and ^), A348089 (using +, -, *, / and ^), A348262 (using + and ^).
Cf. A000792 (largest integer of given complexity), A003313, A076142, A076091, A061373, A005421, A064097, A005520, A003037, A161906, A161908, A244743.

Programs

  • Haskell
    import Data.List (genericIndex)
    a005245 n = a005245_list `genericIndex` (n-1)
    a005245_list = 1 : f 2 [1] where
       f x ys = y : f (x + 1) (y : ys) where
         y = minimum $
             (zipWith (+) (take (x `div` 2) ys) (reverse ys)) ++
             (zipWith (+) (map a005245 $ tail $ a161906_row x)
                          (map a005245 $ reverse $ init $ a161908_row x))
    -- Reinhard Zumkeller, Mar 08 2013
    
  • Maple
    with(numtheory):
    a:= proc(n) option remember;
          `if`(n=1, 1, min(seq(a(i)+a(n-i), i=1..n/2),
           seq(a(d)+a(n/d), d=divisors(n) minus {1, n})))
        end:
    seq(a(n), n=1..100); # Alois P. Heinz, Apr 18 2012
  • Mathematica
    a[n_] := a[n] = If[n == 1, 1,
       Min[Table[a[i] + a[n-i], {i, 1, n/2}] ~Join~
       Table[a[d] + a[n/d], {d, Divisors[n] ~Complement~ {1, n}}]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Dec 12 2013, after Alois P. Heinz *)
  • PARI
    A005245(n /* start by calling this with the largest needed n */, lim/* see below */) = { local(d); n<6 && return(n);
    if(n<=#A005245, A005245[n]&return(A005245[n]) /* return memoized result if available */,
    A005245=vector(n) /* create vector if needed - should better reuse existing data if available */);
    for(i=1, n-1, A005245[i] || A005245[i]=A005245(i,lim)); /* compute all previous elements */
    A005245[n]=min( vecmin(vector(min(n\2,if(lim>0,lim,n)), k, A005245[k]+A005245[n-k])) /* additive possibilities - if lim>0 is given, consider a(k)+a(n-k) only for k<=lim - we know it is save to use lim=1 up to n=2e7 */, if( isprime(n), n, vecmin(vector((-1+#d=divisors(n))\2, i, A005245[d[i+1]]+A005245[d[ #d-i]]))/* multiplicative possibilities */))}
    \\ See also the Python program by Tim Peters at A005421.
    \\ M. F. Hasler, Jan 30 2008
    
  • Python
    from functools import lru_cache
    from itertools import takewhile
    from sympy import divisors
    @lru_cache(maxsize=None)
    def A005245(n): return min(min(A005245(a)+A005245(n-a) for a in range(1,(n>>1)+1)),min((A005245(d)+A005245(n//d) for d in takewhile(lambda d:d*d<=n,divisors(n)) if d>1),default=n)) if n>1 else 1 # Chai Wah Wu, Apr 29 2023

Formula

It is known that a(n) <= A061373(n) but I think 0 <= A061373(n) - a(n) <= 1 also holds. - Benoit Cloitre, Nov 23 2003 [That's false: the numbers {46, 235, 649, 1081, 7849, 31669, 61993} require {1, 2, 3, 4, 5, 6, 7} fewer 1's in A005245 than in A061373. - Ed Pegg Jr, Apr 13 2004]
It is known from the work of Selfridge and Coppersmith that 3 log_3 n <= a(n) <= 3 log_2 n = 4.754... log_3 n for all n > 1. [Guy, Unsolved Problems in Number Theory, Sect. F26.] - Charles R Greathouse IV, Apr 19 2012 [Comment revised by N. J. A. Sloane, Jul 17 2016]
Zelinsky (2022) improves the upper bound to a(n) <= A*log n where A = 41/log(55296) = 3.754422.... This compares to the constant 2.7307176... of the lower bound. - Charles R Greathouse IV, Dec 11 2022
a(n) >= A007600(n) is a very accurate lower bound. - Mehmet Sarraç, Dec 18 2022

Extensions

More terms from David W. Wilson, May 15 1997

A064097 A quasi-logarithm defined inductively by a(1) = 0 and a(p) = 1 + a(p-1) if p is prime and a(n*m) = a(n) + a(m) if m,n > 1.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 5, 5, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 6, 6, 7, 6, 7, 5, 7, 6, 7, 6, 7, 7, 7, 6, 7, 7, 8, 7, 7, 8, 9, 6, 8, 7, 7, 7, 8, 7, 8, 7, 8, 8, 9, 7, 8, 8, 8, 6, 8, 8, 9, 7, 9, 8, 9, 7, 8, 8, 8, 8, 9, 8, 9, 7, 8, 8, 9, 8, 8, 9, 9, 8, 9, 8, 9, 9, 9, 10, 9, 7, 8, 9, 9, 8, 9, 8, 9, 8
Offset: 1

Views

Author

Thomas Schulze (jazariel(AT)tiscalenet.it), Sep 16 2001

Keywords

Comments

Note that this is the logarithm of a completely multiplicative function. - Michael Somos
Number of iterations of r -> r - (largest divisor d < r) needed to reach 1 starting at r = n. a(n) = a(n - A032742(n)) + 1 for n >= 2. - Jaroslav Krizek, Jan 28 2010
From Antti Karttunen, Apr 04 2020: (Start)
Krizek's comment above stems from the fact that n - n/p = (p-1)*(n/p), where p is the least prime dividing n [= A020639(n), thus n/p = A032742(n)] and because this is fully additive sequence we can write a(n) = a(p) + a(n/p) = (1+a(p-1)) + a(n/p) = 1 + a((p-1)*(n/p)) = 1 + a(n - n/p), for any composite n.
Note that in above formula p can be any prime factor of n, not only the smallest, which proves Robert G. Wilson v's comment in A333123 that all such iteration paths from n to 1 are of the same length, regardless of the route taken.
(End)
From Antti Karttunen, May 11 2020: (Start)
Moreover, those paths form the chains of a graded poset, which is also a lattice. See the Mathematics Stack Exchange link.
Keeping the formula otherwise same, but changing it for primes either as a(p) = 1 + a(A064989(p)), a(p) = 1 + a(floor(p/2)) or a(p) = 1 + a(A048673(p)) gives sequences A056239, A064415 and A334200 respectively.
(End)
a(n) is the number of iterations r->A060681(r) to reach 1 starting at r=n. - R. J. Mathar, Nov 06 2023

Examples

			a(19) = 6: 19 - 1 = 18; 18 - 9 = 9; 9 - 3 = 6; 6 - 3 = 3; 3 - 1 = 2; 2 - 1 = 1. That is a total of 6 iterations. - _Jaroslav Krizek_, Jan 28 2010
From _Antti Karttunen_, Apr 04 2020: (Start)
We can follow also alternative routes, where we do not always select the largest proper divisor to subtract, for example, from 19 to 1, we could go as:
19-1 = 18; 18-(18/3) = 12; 12-(12/2) = 6; 6-(6/3) = 4; 4-(4/2) = 2; 2-(2/2) = 1, or as
19-1 = 18; 18-(18/3) = 12; 12-(12/3) = 8; 8-(8/2) = 4; 4-(4/2) = 2; 2-(2/2) = 1,
both of which also have exactly 6 iterations.
(End)
		

Crossrefs

Similar to A061373 which uses the same recurrence relation but a(1) = 1.
Cf. A000079 (position of last occurrence), A105017 (position of records), A334197 (positions of record jumps upward).
Partial sums of A334090.
Cf. also A056239.

Programs

  • Haskell
    import Data.List (genericIndex)
    a064097 n = genericIndex a064097_list (n-1)
    a064097_list = 0 : f 2 where
       f x | x == spf  = 1 + a064097 (spf - 1) : f (x + 1)
           | otherwise = a064097 spf + a064097 (x `div` spf) : f (x + 1)
           where spf = a020639 x
    -- Reinhard Zumkeller, Mar 08 2013
    
  • Maple
    a:= proc(n) option remember;
          add((1+a(i[1]-1))*i[2], i=ifactors(n)[2])
        end:
    seq(a(n), n=1..120);  # Alois P. Heinz, Apr 26 2019
    # alternative which can be even used outside this entry
    A064097 := proc(n)
            option remember ;
            add((1+procname(i[1]-1))*i[2], i=ifactors(n)[2]) ;
    end proc:
    seq(A064097(n),n=1..100) ; # R. J. Mathar, Aug 07 2022
  • Mathematica
    quasiLog := (Length@NestWhileList[# - Divisors[#][[-2]] &, #, # > 1 &] - 1) &;
    quasiLog /@ Range[1024]
    (* Terentyev Oleg, Jul 17 2011 *)
    fi[n_] := Flatten[ Table[#[[1]], {#[[2]]}] & /@ FactorInteger@ n]; a[1] = 0; a[n_] := If[ PrimeQ@ n, a[n - 1] + 1, Plus @@ (a@# & /@ fi@ n)]; Array[a, 105] (* Robert G. Wilson v, Jul 17 2013 *)
    a[n_] := Length@ NestWhileList[# - #/FactorInteger[#][[1, 1]] &, n, # != 1 &] - 1; Array[a, 100] (* or *)
    a[n_] := a[n - n/FactorInteger[n][[1, 1]]] +1; a[1] = 0; Array[a, 100]  (* Robert G. Wilson v, Mar 03 2020 *)
  • PARI
    NN=200; an=vector(NN);
    a(n)=an[n];
    for(n=2,NN,an[n]=if(isprime(n),1+a(n-1), sumdiv(n,p, if(isprime(p),a(p)*valuation(n,p)))));
    for(n=1,100,print1(a(n)", "))
    
  • PARI
    a(n)=if(isprime(n), return(a(n-1)+1)); if(n==1, return(0)); my(f=factor(n)); apply(a,f[,1])~ * f[,2] \\ Charles R Greathouse IV, May 10 2016
    
  • Scheme
    (define (A064097 n) (if (= 1 n) 0 (+ 1 (A064097 (A060681 n))))) ;; After Jaroslav Krizek's Jan 28 2010 formula.
    (define (A060681 n) (- n (A032742 n))) ;; See also code under A032742.
    ;; Antti Karttunen, Aug 23 2017

Formula

Conjectures: for n>1, log(n) < a(n) < (5/2)*log(n); lim n ->infinity sum(k=1, n, a(k))/(n*log(n)-n) = C = 1.8(4)... - Benoit Cloitre, Oct 30 2002
Conjecture: for n>1, floor(log_2(n)) <= a(n) < (5/2)*log(n). - Robert G. Wilson v, Aug 10 2013
a(n) = Sum_{k=1..n} a(p_k)*e_k if n is composite with factorization p_1^e_1 * ... * p_k^e_k. - Orson R. L. Peters, May 10 2016
From Antti Karttunen, Aug 23 2017: (Start)
a(1) = 0; for n > 1, a(n) = 1 + a(A060681(n)). [From Jaroslav Krizek's Jan 28 2010 formula in comments.]
a(n) = A073933(n) - 1. (End)
a(n) = A064415(n) + A329697(n) [= A054725(n) + A329697(n), for n > 1]. - Antti Karttunen, Apr 16 2020
a(n) = A323077(n) + A334202(n) = a(A052126(n)) + a(A006530(n)). - Antti Karttunen, May 12 2020

Extensions

More terms from Michael Somos, Sep 25 2001
Previous Showing 11-20 of 65 results. Next