login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A252895 Numbers with an odd number of square divisors. 4
1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 16, 17, 19, 21, 22, 23, 26, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 46, 47, 48, 51, 53, 55, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 71, 73, 74, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 96, 97 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Open lockers in the locker problem where the student numbers are the set of perfect squares.

The locker problem is a classic mathematical problem. Imagine a row containing an infinite number of lockers numbered from one to infinity. Also imagine an infinite number of students numbered from one to infinity. All of the lockers begin closed. The first student opens every locker that is a multiple of one, which is every locker. The second student closes every locker that is a multiple of two, so all of the even-numbered lockers are closed. The third student opens or closes every locker that is a multiple of three. This process continues for all of the students.

A variant on the locker problem is when not all student numbers are considered; in the case of this sequence, only the square-numbered students open and close lockers. The sequence here is a list of the open lockers after all of the students have gone.

n is in the sequence if and only if it is the product of a squarefree number (A005117) and a fourth power (A000583). - Robert Israel, Apr 07 2015

Let D be the multiset containing d0(k), the divisor counting function, for each divisor k of n. n is in the sequence if and only if D admits a partition into two parts A and B such that the sum of the elements of A is exactly one more or less than the sum of the elements of B. For example, if n = 80, we have D = {1, 2, 2, 3, 4, 4, 5, 6, 8, 10}, and A = {1, 2, 3, 4, 4, 8} and B = {2, 5, 6, 10}. The sum of A is 22, and the sum of B is 23. - Griffin N. Macris, Oct 10 2016

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

K. A. P. Dagal, Generalized Locker Problem, arXiv:1307.6455 [math.NT], 2013.

B. Torrence and S. Wagon, The Locker Problem, Crux Mathematicorum, 2007, 33(4), 232-236.

EXAMPLE

The set of divisors of 6 is {1,2,3,6}, which contains only one perfect square: 1; therefore 6 is a term.

The set of divisors of 16 is {1,2,4,8,16}, which contains three perfect squares: 1, 4, and 16; therefore 16 is a term.

The set of divisors of 4 is {1,2,4}, which contains two perfect squares: 1 and 4; therefore 4 is not a term.

MAPLE

N:= 1000: # to get all terms <= N

S:= select(numtheory:-issqrfree, {$1..N}):

map(s -> seq(s*i^4, i = 1 .. floor((N/s)^(1/4))), S);

# if using Maple 11 or earlier, uncomment the next line

# sort(convert(%, list)); # Robert Israel, Apr 07 2015

MATHEMATICA

Position[Length@ Select[Divisors@ #, IntegerQ@ Sqrt@ # &] & /@ Range@ 70, _Integer?OddQ] // Flatten (* Michael De Vlieger, Mar 23 2015 *)

a[n_] := DivisorSigma[0, Total[EulerPhi/@Select[Sqrt[Divisors[n]], IntegerQ]]]; Flatten[Position[a/@Range@100, _?OddQ]] (* Ivan N. Ianakiev, Apr 07 2015 *)

Select[Range@ 100, OddQ@ Length@ DeleteCases[Divisors@ #, k_ /; ! IntegerQ@ Sqrt@ k] &] (* Michael De Vlieger, Oct 10 2016 *)

PROG

(C++)

#include <iostream>

using namespace std;

int main()

{

const int one_k = 1000;

//all numbers in sequence up to one_k are given

int lockers [one_k] = {};

int A = 0;

while (A < one_k) {

  lockers [A] = A+1;

  A = A + 1;

}

int B = 1;

while ( ((B) * (B)) <= one_k) {

  int C = ((B) * (B));

  int D = one_k/C;

  int E = 1;

  while (E <= D) {

    lockers [(C*E)-1] = -1 * lockers [(C*E)-1];

    E = E + 1;

  }

  B = B + 1;

}

int F = 0;

while (F < one_k) {

  if (lockers [F] < 0) {

    cout << (-1 * lockers [F]) << endl;

  }

F = F + 1;

}

return 0;

} // Walker Dewey Anderson, Mar 22 2015

(PARI) isok(n) = sumdiv(n, d, issquare(d)) % 2; \\ Michel Marcus, Mar 22 2015

(Sage) [n for n in [1..200] if len([x for x in divisors(n) if is_square(x)])%2==1] # Tom Edgar, Mar 22 2015

(Haskell)

a252895 n = a252895_list !! (n-1)

a252895_list = filter (odd . a046951) [1..]

-- Reinhard Zumkeller, Apr 06 2015

CROSSREFS

Cf. A000290, A000583, A005117, A046951, A252849.

Sequence in context: A101882 A318239 A059266 * A274034 A197680 A119024

Adjacent sequences:  A252892 A252893 A252894 * A252896 A252897 A252898

KEYWORD

nonn

AUTHOR

Walker Dewey Anderson, Mar 22 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 2 07:15 EDT 2020. Contains 334767 sequences. (Running on oeis4.)