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 61-70 of 110 results. Next

A122155 Simple involution of natural numbers: List each block of (2^k)-1 numbers (from (2^k)+1 to 2^(k+1) - 1) in reverse order and fix the powers of 2.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 25 2006

Keywords

Comments

From Kevin Ryde, Dec 29 2020: (Start)
a(n) is n with an 0<->1 complement applied to each bit between, but not including, the most significant and least significant 1-bits. Dijkstra uses this form and calls the complemented bits the "internal" digits.
The fixed points a(n)=n are n=0 and n=A029744. These are n=2^k by construction, and the middle of each reversed block is n=3*2^k. In terms of bit complement, these n have nothing between their highest and lowest 1-bits.
(End)

Examples

			From _Kevin Ryde_, Dec 29 2020: (Start)
  n    = 4, 5, 6, 7, 8
  a(n) = 4, 7, 6, 5, 8  between powers of 2
             <----      block reverse
Or a single term by bits,
  n    = 236 = binary 11101100
  a(n) = 148 = binary 10010100  complement between
                       ^^^^     high and low 1's
(End)
		

Crossrefs

Cf. A029744 (fixed points), A334045 (complement high/low 1's too), A057889 (bit reversal).

Programs

  • Mathematica
    Array[(1 + Boole[#1 - #2 != 0]) #2 - #1 + #2 & @@ {#, 2^(IntegerLength[#, 2] - 1)} &, 69] (* Michael De Vlieger, Jan 01 2023 *)
  • PARI
    a(n) = bitxor(n,if(n,max(0, 1<Kevin Ryde, Dec 29 2020
    
  • Python
    def A122155(n): return int(('1'if (m:=len(s:=bin(n)[2:])-(n&-n).bit_length())>0 else '')+''.join(str(int(d)^1) for d in s[1:m])+s[m:],2) if n else 0 # Chai Wah Wu, May 19 2023
    
  • Python
    def A122155(n): return n^((1<Chai Wah Wu, Mar 10 2025
  • R
    maxblock <- 5 # by choice
    a <- 1
    for(m in 1:maxblock){
                          a[2^m    ] <- 2^m
      for(k in 1:(2^m-1)) a[2^m + k] <- 2^(m+1) - k
    }
    (a <- c(0,a))
    # Yosu Yurramendi, Mar 18 2021
    
  • Scheme
    (define (A122155 n) (cond ((< n 1) n) ((pow2? n) n) (else (- (* 2 (A053644 n)) (A053645 n)))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))
    

Formula

a(0) = 0; if n=2^k, a(n) = n; if n=2^k + i (with i > 0 and i < 2^k) a(n) = 2^(k+1) - i = 2*A053644(n) - A053645(n).
A002487(a(n)) = A002487(n), n >= 0 [Dijkstra]. - Yosu Yurramendi, Mar 18 2021

A157226 Number of primitive inequivalent sublattices of square lattice having mirrors parallel to the sides of the unit cell of the parent lattice of index n.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 2, 1, 3, 1, 4, 1, 3, 2, 2, 1, 3, 1, 4, 2, 3, 1, 4, 1, 3, 1, 4, 1, 6, 1, 2, 2, 3, 2, 4, 1, 3, 2, 4, 1, 6, 1, 4, 2, 3, 1, 4, 1, 3, 2, 4, 1, 3, 2, 4, 2, 3, 1, 8, 1, 3, 2, 2, 2, 6, 1, 4, 2, 6, 1, 4, 1, 3, 2, 4, 2, 6, 1, 4, 1, 3, 1, 8, 2, 3, 2
Offset: 1

Views

Author

N. J. A. Sloane, Feb 25 2009

Keywords

Comments

Andrey Zabolotskiy's new formula confirms that a(n) indeed is a function of A305891(n). - Antti Karttunen, Oct 01 2018

Crossrefs

Cf. A145393 (all sublattices of the square lattice), A019590, A157228, A157230, A157231, A304182, A007875, A029744.

Programs

Formula

From Andrey Zabolotskiy, Sep 30 2018: (Start)
Let b(n) = A007875(n) for n>1, b(1) = 0. Then
a(n) = b(n) for odd n,
a(n) = b(n) + b(n/2) for even n.
Thus the sorted list of all terms (except for a(1)=0) is A029744. (End)

Extensions

New name and more terms from Andrey Zabolotskiy, May 09 2018

A260355 Table T(n,k) read by antidiagonals. T(n,k) is the minimum value of Sum_{i=1..n} Product_{j=1..k} r_j[i] where each r_j is a permutation of {1..n}.

Original entry on oeis.org

1, 1, 3, 1, 4, 6, 1, 6, 10, 10, 1, 8, 18, 20, 15, 1, 12, 33, 44, 35, 21, 1, 16, 60, 96, 89, 56, 28, 1, 24, 108, 214, 231, 162, 84, 36, 1, 32, 198, 472, 600, 484, 271, 120, 45, 1, 48, 360, 1043, 1564, 1443, 915, 428, 165, 55, 1, 64, 648, 2304, 4074, 4320, 3089, 1608, 642, 220, 66, 1, 96, 1188, 5136, 10618
Offset: 1

Views

Author

Chai Wah Wu, Jul 29 2015

Keywords

Comments

T(1,k) = 1. T(2,k) = A029744(k+2). T(n,1) = n(n+1)/2 (= A000217(n)). See arXiv link for sets of permutations that achieve the value of T(n,k).

Examples

			(Partially filled in) table starts (with n rows and k columns):
(Third column is A070735, fourth column is A070736)
   k    1   2     3     4     5     6     7     8     9    10    11    12     13     14     15
  --------------------------------------------------------------------------------------------
n  1|   1   1     1     1     1     1     1     1     1     1     1     1      1      1      1
   2|   3   4     6     8    12    16    24    32    48    64    96   128    192    256    384
   3|   6  10    18    33    60   108   198   360   648  1188  2145  3888   7083  12844  23328
   4|  10  20    44    96   214   472  1043  2304  5136 11328 24993 55296 122624 271040 599832
   5|  15  35    89   231   600  1564  4074 10618
   6|  21  56   162   484  1443  4320
   7|  28  84   271   915  3089
   8|  36 120   428  1608
   9|  45 165   642  2664
  10|  55 220   930  4208
  11|  66 286  1304
  12|  78 364  1781
  13|  91 455  2377
  14| 105 560  3111
  15| 120 680  4002
(Partially filled in) table of how many nonequivalent sets of permutations achieves the value of T(n,k)
   k    1    2     3     4     5     6     7     8     9    10    11    12    13     14     15
  --------------------------------------------------------------------------------------------
n  1|   1    1     1     1     1     1     1     1     1     1     1     1     1      1      1
   2|   1    1     1     1     1     1     1     1     1     1     1     1     1      1      1
   3|   1    1     1     1     1     2     1     2     2     2     1     3     1      1      3
   4|   1    1     2     4    11    10    10    81   791   533    24  1461  3634    192   2404
   5|   1    1     3    12    16   188   211  2685
   6|   1    1    10   110    16
   7|   1    1     6
   8|   1    1    16
   9|   1    1     4
  10|   1    1    12
  11|   1    1
  12|   1    1
  13|   1    1
  14|   1    1
  15|   1    1
		

Crossrefs

Cf. A001563, A029744, A000217, A000292 (T(n,2)), A070735 (T(n,3)), A070736 (T(n,4)).

Programs

  • Python
    from itertools import permutations, combinations_with_replacement
    def A260355(n,k): # compute T(n,k)
        if k == 1:
            return n*(n+1)//2
        ntuple, count = tuple(range(1,n+1)), n**(k+1)
        for s in combinations_with_replacement(permutations(ntuple,n),k-2):
            t = list(ntuple)
            for d in s:
                for i in range(n):
                    t[i] *= d[i]
            t.sort()
            v = 0
            for i in range(n):
                v += (n-i)*t[i]
            if v < count:
                count = v
        return count

Formula

From Chai Wah Wu, Feb 24 2020: (Start)
T(n,k) >= n*(n!)^(k/n).
If n divides k, then T(n,k) = n*(n!)^(k/n).
T(n,n) = (n+1)! - n! = A001563(n).
T(n,2) = n*(n+1)*(n+2)/6 = A000292(n).
(End)

A322838 Number of positive integers less than n with more prime factors than n, counted with multiplicity.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 2, 0, 1, 1, 5, 0, 6, 2, 2, 0, 9, 1, 10, 1, 5, 5, 13, 0, 6, 6, 2, 2, 18, 2, 19, 0, 10, 10, 10, 1, 24, 11, 11, 1, 27, 5, 28, 5, 5, 15, 31, 0, 16, 6, 17, 6, 36, 2, 19, 2, 20, 20, 41, 2, 42, 21, 9, 0, 23, 10, 47, 10, 25, 10, 50, 1, 51, 27, 11, 11
Offset: 1

Views

Author

Gus Wiseman, Dec 28 2018

Keywords

Examples

			Column n lists the a(n) positive integers less than n with more prime factors than n:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20
  ---------------------------------------------------------------------
              4     6     8  8   10      12  12  12      16  16  18  16
                    4            9       10  8   8       15      16
                                 8       9               14      15
                                 6       8               12      14
                                 4       6               10      12
                                         4               9       10
                                                         8       9
                                                         6       8
                                                         4       6
                                                                 4
		

Crossrefs

Positions of zeros appear to be A029744.

Programs

  • Mathematica
    Table[Length[Select[Range[n],PrimeOmega[#]>PrimeOmega[n]&]],{n,100}]

A029748 Numbers of the form 2^k times 1, 3 or 7.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 12, 14, 16, 24, 28, 32, 48, 56, 64, 96, 112, 128, 192, 224, 256, 384, 448, 512, 768, 896, 1024, 1536, 1792, 2048, 3072, 3584, 4096, 6144, 7168, 8192, 12288, 14336, 16384, 24576, 28672, 32768, 49152, 57344, 65536, 98304, 114688, 131072
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-(x^5 + 2 x^4 + 2 x^3 + 3 x^2 + 2 x + 1)/(2 x^3 - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Oct 18 2013 *)
    Sort[Flatten[#{1,3,7}&/@(2^Range[0,20])]] (* Harvey P. Dale, Jan 30 2014 *)

Formula

From Colin Barker, Jul 19 2013: (Start)
a(n) = 2*a(n-3) for n>5.
G.f.: -(x^5+2*x^4+2*x^3+3*x^2+2*x+1) / (2*x^3-1). (End)
Sum_{n>=0} 1/a(n) = 62/21. - Amiram Eldar, Jan 17 2022

Extensions

More terms from Colin Barker, Jul 19 2013

A056488 Number of periodic palindromes using a maximum of six different symbols.

Original entry on oeis.org

6, 21, 36, 126, 216, 756, 1296, 4536, 7776, 27216, 46656, 163296, 279936, 979776, 1679616, 5878656, 10077696, 35271936, 60466176, 211631616, 362797056, 1269789696, 2176782336, 7618738176, 13060694016, 45712429056, 78364164096, 274274574336, 470184984576
Offset: 1

Views

Author

Keywords

Comments

Also number of necklaces with n beads and 6 colors that are the same when turned over and hence have reflection symmetry. - Herbert Kociemba, Nov 24 2016

Examples

			G.f. = 6*x + 21*x^2 + 36*x^3 + 126*x^4 + 216*x^5 + 756*x^6 + 1296*x^7 + ...
For example, aaabbb is not a (finite) palindrome but it is a periodic palindrome.
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column 6 of A284855.

Programs

  • Magma
    [IsEven(n) select 6^(n div 2)*7/2 else 6^((n+1) div 2): n in [1..30]]; // Vincenzo Librandi, Sep 22 2018
  • Mathematica
    LinearRecurrence[{0,6},{6,21},30] (* Harvey P. Dale, Feb 02 2015 *)
    k = 6; Table[(k^Floor[(n + 1)/2] + k^Ceiling[(n + 1)/2]) / 2, {n, 30}] (* Robert A. Russell, Sep 21 2018 *)
    If[EvenQ[#], 6^(# / 2) 7/2, 6^((# + 1) / 2)]&/@Range[30] (* Vincenzo Librandi, Sep 22 2018 *)
  • PARI
    a(n) = if(n%2, 6^((n+1)/2), 7*6^(n/2)/2); \\ Altug Alkan, Sep 21 2018
    

Formula

a(n) = 6^((n+1)/2) for n odd, a(n) = 6^(n/2)*7/2 for n even.
From Colin Barker, Jul 08 2012: (Start)
a(n) = 6*a(n-2).
G.f.: 3*x*(2+7*x)/(1-6*x^2). (End)
a(n) = (k^floor((n+1)/2) + k^ceiling((n+1)/2)) / 2, where k = 6 is the number of possible colors. - Robert A. Russell, Sep 22 2018

Extensions

More terms from Vincenzo Librandi, Sep 22 2018

A082125 Smallest difference>1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 4.

Original entry on oeis.org

4, 3, 4, 2, 4, 8, 16, 64, 512, 16384, 2097152, 2147483648, 140737488355328, 1180591620717411303424, 40564819207303340847894502572032, 365375409332725729550921208179070754913983135744
Offset: 0

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Comments

a(n) is a power of two for n>1 and log_2(a(n))=A073941(n) for n>2. - Ralf Stephan, Apr 16 2003

Crossrefs

Cf. A082120, A003681 (starts with 2, 3), A082126.
Cf. A029744.

Programs

  • PARI
    p=4; print1(p, ", "); for(n=1, 50, v=divisors(p); r=sqrt(p); t=0; for(k=1, matsize(v)[2], if(v[k]>=r, t=k; break)); if(v[t]^2==p, u=t, u=t-1); if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "); p=p*(v[t]-v[u]))

A082588 a(1) = 1, a(n) = Sum_{d | n and d < n} a(d)^2 for n > 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 6, 2, 3, 1, 16, 1, 3, 3, 42, 1, 16, 1, 16, 3, 3, 1, 308, 2, 3, 6, 16, 1, 31, 1, 1806, 3, 3, 3, 532, 1, 3, 3, 308, 1, 31, 1, 16, 16, 3, 1, 96936, 2, 16, 3, 16, 1, 308, 3, 308, 3, 3, 1, 1508, 1, 3, 16, 3263442, 3, 31, 1, 16, 3, 31, 1, 378456
Offset: 1

Views

Author

Reinhard Zumkeller, May 13 2003

Keywords

Comments

The positions of records are A029744. - Andrey Zabolotskiy, Jan 30 2017

Examples

			a(12) = a(1)^2 + a(2)^2 + a(3)^2 + a(4)^2 + a(6)^2 = 1^2 + 1^2 + 1^2 + 2^2 + 3^2 = 1 + 1 + 1 + 4 + 9 = 16.
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := If[ n < 2, Boole[n == 1], Sum[ a[d]^2, {d, Drop[Divisors @ n, -1]}]]; (* Michael Somos, May 19 2018 *)
  • PARI
    a(n) = if (n==1, 1, sumdiv(n, d, if (dMichel Marcus, Jan 30 2017
  • Python
    a = [1]
    for n in range(2, 10001):
       a.append(sum(a[d-1]**2 for d in range(1, n) if n%d == 0))
    print(a)
    # Andrey Zabolotskiy, Jan 30 2017
    

Formula

a(p^(n+1)) = A007018(n) if p is a prime. - Michael Somos, May 19 2018

Extensions

Typo in data corrected by Andrey Zabolotskiy, Jan 30 2017

A116998 Numbers having no fewer distinct prime factors than any predecessor; a(1) = 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, 26, 28, 30, 42, 60, 66, 70, 78, 84, 90, 102, 105, 110, 114, 120, 126, 130, 132, 138, 140, 150, 154, 156, 165, 168, 170, 174, 180, 182, 186, 190, 195, 198, 204, 210, 330, 390, 420, 462, 510, 546, 570, 630, 660
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 03 2006

Keywords

Comments

A001221(a(n)) <= A001221(a(n+1));
A002110 is a subsequence.
The unitary version of Ramanujan's largely composite numbers (A067128), numbers having no fewer unitary divisors than any predecessor. - Amiram Eldar, Jun 08 2019
Called omega-largely composite numbers by Erdős and Nicolas (1981). - Amiram Eldar, Jun 24 2023

Crossrefs

Cf. A001221 (omega), A002110 (primorial numbers).

Programs

  • Maple
    a:= proc(n) option remember; local k, t;
          t:= nops(ifactors(a(n-1))[2]);
          for k from 1+a(n-1) while nops(ifactors(k)[2])Alois P. Heinz, Oct 05 2012
  • Mathematica
    a[1] = 1; a[n_] := a[n] = For[nu = PrimeNu[a[n-1]]; k = a[n-1]+1, True, k++, If[PrimeNu[k] >= nu, Return[k]]]; Array[a, 80] (* Jean-François Alcover, Apr 11 2017 *)

A118306 If n = product{k>=1} p(k)^b(n,k), where p(k) is the k-th prime and where each b(n,k) is a nonnegative integer, then: If n occurs earlier in the sequence, then a(n) = product{k>=2} p(k-1)^b(n,k); If n does not occur earlier in the sequence, then a(n) = product{k>=1} p(k+1)^b(n,k).

Original entry on oeis.org

1, 3, 2, 9, 7, 15, 5, 27, 4, 21, 13, 45, 11, 33, 6, 81, 19, 75, 17, 63, 10, 39, 29, 135, 49, 51, 8, 99, 23, 105, 37, 243, 14, 57, 77, 225, 31, 69, 22, 189, 43, 165, 41, 117, 12, 87, 53, 405, 25, 147, 26, 153, 47, 375, 91, 297, 34, 93, 61, 315, 59, 111, 20, 729, 119, 195, 71
Offset: 1

Views

Author

Leroy Quet, May 14 2006

Keywords

Comments

Sequence is a permutation of the positive integers and it is its own inverse permutation.
From Antti Karttunen, Nov 05 2016: (Start)
A016945 gives the positions of even terms.
A007310 is closed with respect to this permutation. See A277911 for the permutation induced.
A029744 (without 3) seems to give the positions of records in this sequence (note that it gives the record positions in related A003961 and A048673) which implies that A083658 (without its term 5) would then give the record values.
(End)

Crossrefs

Programs

  • Maple
    A064989 := proc(n) local a,ifs,p ; a := 1 ; ifs := ifactors(n)[2] ; for p in ifs do if op(1,p) > 2 then a := a* prevprime(op(1,p))^op(2,p) ; fi ; od; RETURN(a) ; end: A003961 := proc(n) local a,ifs,p ; a := 1 ; ifs := ifactors(n)[2] ; for p in ifs do a := a* nextprime(op(1,p))^op(2,p) ; od; RETURN(a) ; end: A118306 := proc(nmin) local a,anxt,i,n ; a := [1] ; while nops(a) < nmin do n := nops(a)+1 ; if n in a then anxt := A064989(n) ; else anxt := A003961(n) ; fi ; a := [op(a),anxt] ; od; a ; end: A118306(100) ; # R. J. Mathar, Sep 06 2007
  • PARI
    A118306(n) = { if(1==n, 1, my(f = factor(n)); my(d = (-1)^primepi(f[1, 1])); for(i=1, #f~, f[i, 1] = prime(primepi(f[i, 1])-d)); factorback(f)); }; \\ Antti Karttunen, Nov 06 2016
    for(n=1, 10001, write("b118306.txt", n, " ", A118306(n)));
    
  • Scheme
    (define (A118306 n) (cond ((= 1 n) n) ((odd? (A055396 n)) (A003961 n)) (else (A064989 n)))) ;; Antti Karttunen, Nov 05 2016

Formula

From Antti Karttunen, Nov 05 2016: (Start)
a(1) = 1; and for n > 1, if n = a(k) for some k = 1 .. n-1, then a(n) = A064989(n), otherwise a(n) = A003961(n). [After the original definition and R. J. Mathar's Maple-code]
a(1) = 1, and for n > 1, if A055396(n) is odd, a(n) = A003961(n), otherwise a(n) = A064989(n). [The above reduces to this.]
a(n) = product{k>=1} prime(k-((-1)^A055396(n)))^e(k) when n = product{k>=1} prime(k)^e(k).
a(2n) = A249734(n) and a(A249734(n)) = 2n.
A126760(a(A007310(n))) = A277911(n).
For n > 1, A055396(a(n)) = A055396(n) - (-1)^A055396(n). [Permutation sends the terms on any odd row of A246278 to the next even row just below, and vice versa.]
A246277(a(n)) = A246277(n). [While keeping them in the same column.]
a(n) = A064989(A064989(a(A003961(A003961(n))))).
(End)

Extensions

More terms from R. J. Mathar, Sep 06 2007
A small omission in the definition corrected by Antti Karttunen, Nov 05 2016
Previous Showing 61-70 of 110 results. Next